The Best React Code I Wrote (Code Review)

Поделиться
HTML-код
  • Опубликовано: 17 сен 2024
  • Try Brilliant Free for 30 days + 20% Off Premium Membership → brilliant.org/...
    🚀 Project React → cosden.solutio...
    📥 Import React (Newsletter) → cosden.solutio...
    🧙🏻‍♂️ Habit Quest → habitquest.io
    Join The Discord! → discord.cosden...
    VSCode Theme | Font → Material Theme Darker | Menlo, Monaco "monospace"
    In this video we'll be reviewing the best code I've written so far in React! This is an app that I've built recently on the livestreams with you guys. It has tons of design patterns, best practices, and really cool solutions to problems. Let's look at the code and see how it was built!

Комментарии • 25

  • @JanVerny
    @JanVerny День назад +2

    It's always interesting to look at someone else's code base. First impression is that I feel like typescript isn't being used to it's full potential in a lot of the places. I would certainly define ItemRarity type over using Item["rarity"], etc.
    And that using a centralized store like redux or something similar would significantly reduce the amount of info that needs to be passed around on the routes or remove the need for routing entirely. I am personally not a fan of routing outside of allowing for bookmarks, navigation, etc.

  • @martapfahl940
    @martapfahl940 День назад +1

    This code equals a composition. Great work!

  • @adityaprasad3122
    @adityaprasad3122 День назад +3

    I like your teaching style make a nextjs course ❤

  • @johngregoryfuntera670
    @johngregoryfuntera670 День назад

    @4:21 I think the way you can make the providers more cleaner and maintainable is to have a main app provider wrapper the stores all of the providers then just have children a prop. {children}

  • @amralimohamed6497
    @amralimohamed6497 День назад +1

    Love from Egypt 🇪🇬

  • @azerxkhamassi
    @azerxkhamassi День назад +2

    Should I assign setTimeout to a ref and clear it using clearTimeout in React to avoid potential memory leaks and ensure proper cleanup, or is there a more efficient approach for managing timeouts?

    • @XavierGoncalves89
      @XavierGoncalves89 День назад +1

      there is not need for a ref, just assign the id to a regular variable and clear it in the useffect cleanup

  • @orijoseph6179
    @orijoseph6179 17 часов назад

    I’m a junior dev so I want to ask a question to make things clear, 6:03 in this component you define queries and mutations, for my understanding we shouldn’t write business logic inside the components, but make custom hook instead to make the code more reusable, I would be happy if you can explain why you did it that way.
    I also see that later on you did implemented a custom hook, so why later on and not on 6:00 ?

  • @mohamedsalimbensalem6118
    @mohamedsalimbensalem6118 День назад

    best react dev so far

  • @kthehatter
    @kthehatter День назад

    what about performance when using tailwind in expo project , and do you recommend it for production apps

  • @irfansaeedkhan7242
    @irfansaeedkhan7242 День назад +1

    Always quality content, love from Pakistan

  • @armaandhanji2112
    @armaandhanji2112 День назад

    Where can we find your stream?

  • @okkkk88612
    @okkkk88612 День назад

    Can you make a youtube course for beginners about Data structures and Algorithm please

  • @prashlovessamosa
    @prashlovessamosa День назад +2

    I miss the purple light in the background.😅

  • @icoderdev
    @icoderdev День назад

    Hi, Cosden ❤

  • @PSMercenary
    @PSMercenary День назад +1

    Senior level. Sure

  • @harshal_madgulkar
    @harshal_madgulkar День назад +3

    Love from BHARAT 🇮🇳

    • @Simple_OG
      @Simple_OG День назад +2

      Just say india

    • @harshal_madgulkar
      @harshal_madgulkar День назад

      @@Simple_OG Both are same bro

    • @Simple_OG
      @Simple_OG День назад

      @@harshal_madgulkar No one understands Bharat at an international level

    • @harshal_madgulkar
      @harshal_madgulkar День назад

      @@Simple_OG I hope they can use Google and see popular and greatest Flag there. And I am proud as it's the original name

  • @orijoseph6179
    @orijoseph6179 17 часов назад

    I’m a junior dev so I want to ask a question to make things clear, 6:03 in this component you define queries and mutations, for my understanding we shouldn’t write business logic inside the components, but make custom hook instead to make the code more reusable, I would be happy if you can explain why you did it that way.
    I also see that later on you did implemented a custom hook, so why later on and not on 6:00 ?