Will It Re-Render? React Game Show

preview_player
Показать описание
Will this button component re-render every time the parent component renders? Let's find out, as we try out memo, useCallback and useRef.

#shorts
Рекомендации по теме
Комментарии
Автор

Life of a react dev summarised in a YouTube short... Will it rerender!!?

RujulSolanki
Автор

Thanks! Ive always wondered about rerenders but was too scared of what I would find if I went looking.

Bluesourboy
Автор

Man I suck at react, can’t believe people pay me to do this. Please keep making more of these.

ChillAutos
Автор

Awesome awesome awesome. This is why I still need both short and long videos from your channel. Thanks so much

tiennsloit
Автор

Man that code was so clean, obvious, and straight, forward.

cas
Автор

I like this! Please do more of these game-show style clips!

SamInNZ
Автор

Dude this is amazing. I love how it’s done. And the content itself is fantastic. I’d recommend this to every junior react dev.

hugodsa
Автор

Understanding how your app re-renders is important. That said, trying to chase every re-render is a waist of time. This is a great lesson for making sure you understand react, but this example would be one where memoizing is not worth it. React is extremely efficient with updates, so worrying about every tiny rerender isn’t worth the time or the uglier code

JonathanRose
Автор

Can you do a lot more of these? 👏🏼👏🏼👏🏼

joshjhans
Автор

One more example of how the useRef hook can be useful for the rendering process in React. But because of using memo, useRef, and useCallback it looks so tricky to implement such a common thing. Dangerous react... Thank you for the great content!

denys.matsevych
Автор

thankyouu so much, i got another point of view on how to compose my codes

bsw
Автор

This was such an awesome way to explain things

-maddhruv
Автор

This question asked my react Interview when I was in 3rd year of graduation. But when I knew this problem and also I knew how to fix this by memoization. But you explain very well thanks for this.🙂🙂

SanjuKumar-hkyy
Автор

Love this idea — turn this into a series :)

docmars
Автор

This is hilarious. React is finally showing it's ugly side and people are noticing. Glad for newer libraries/frameworks

bryson
Автор

any reason why we didn't pass countref to the usecallback's dependency array?

pujanparikh
Автор

Lol this is great, my question is, is it worth it to make components be like this or is this too much?

bekirs
Автор

Wow this short was great. Because usually in react tuts they dont cover this

cowabunga
Автор

I got one question regarding your naming convention. Not sure if you did it unintentionally because it is not relevant in this example, but I would like to hear your opinion on why you did onClick={onShow} - isn't it supposed to pass event handler to an event? For example to name it like onClick={showAlert}, thus making it so obvious from just reading jsx, not having to dig into chained event in order to find out what exactly that function does. I agree that it should be named as event in case when purpose is really to continue with event propagation(along with some other logic, optionally). I come across on this type of naming convention almost everyday(written by other colleagues), where, to my opinion, event handler and event are mixed. What is your opinion on this?

milospavlovic
Автор

Signals can't get here quick enough

markojerkic