Urgent.News

What's breaking now, across thousands of outlets.

More in Tech

Why Does Your React App Re-render So Much?

You update one small piece of state: setCount ( count + 1 ); And suddenly your console looks like this: Header rendered Sidebar rendered ProductList rendered ProductCard rendered Footer rendered Your first thought might be: "Why did half of my React app render again? Isn't this bad for performance?" Not necessarily.

  • React components re-render when their inputs change
  • Re-rendering is normal, not necessarily a problem
  • Causes include state changes, parent re-renders, prop changes, context value changes

More from Sunday 30 August →