DEV Community

Discussion on: Re-rendering in React

Collapse
 
detoner777 profile image
Alexey Lysenko

And we also can use React.memo() for prevent unnecessary rerenders.

Collapse
 
therealnrf profile image
therealnrf

Absolutely. But you'd have to memoize every child component. In the case where the state lives in the root component (like in the original question), you'll have to memoize every component of the app! 😄