React·100 questions

Why does a component re-render and how to understand it?

Answer
Re-rendering due to changes in state/props/context.
Parent re-render doesn't always mean DOM update.
Use React DevTools Profiler.
For debugging, temporarily add logs.
Check stability of props and state selectors.
Was this answer helpful?

More questions in this topic

Related questions from other topics