Why React Child Components Don't Update on Prop Changes

Опубликовано: 25 Февраль 2022
на канале: Peter Elbaum
20,823
365

In React, it's a common problem to have child components that don't re-render when you expect them to. In particular, a common problems is to wonder why a child component doesn't update when its prop changes.

Today, I take you through the bugfix for this problem, and the way that you'd solve for it in both class and functional components.

--
Follow Me Online Here:

🌏 My website/blog - https://peterelbaum.com
✉️ My newsletter (weekly on Sundays) - https://peterelbaum.com/subscribe/
🤓 My courses: https://peterelbaum.gumroad.com/
🗣 One-on-one mentoring - https://superpeer.com/peterelbaum

🐦 Twitter:   / peterelbaum  
💻 GitHub: https://github.com/elbaumpj
☎️ Office Hours: https://calendly.com/elbaumpj/saturda...
--
My gear:

Main Camera: https://amzn.to/2Tv1WBe
Tripod: https://amzn.to/2t570AH
External HD: https://amzn.to/2t1UphI
Memory card: https://amzn.to/2UEQfIn
Computer mic: https://amzn.to/2t7mUue
--
Who am I?

I'm Peter Elbaum, a software engineer living in Raleigh, North Carolina. I make videos about code, software engineering career development, and self improvement. I also have a newsletter (https://peterelbaum.com/subscribe) and tweet my thoughts on money, work, and being a great dev. Feel free to get in touch!