Containerization of State within Child React Components

InstructorTyler Clark

Share this video with your friends

Send Tweet

The changing of state is the reason why components re-render. If you lift all of your state up into the parent container and pass it down to child components, any update to that state in the parent affects all other sibling components. Causing many useless re-renders. By simply moving the state into that child component, saves having to use React.Memo on all sibling components.

https://github.com/twclark0/react-performance

Skylar Bolton
~ 3 years ago

Why in the first version when you had 4 stat cards with the same state did the button not change on all of them when the state was toggled?