Browser

Error: Too many re-renders. React limits the number of renders to prevent an infinite loop.

What it means
A component keeps updating its own state every time it draws, causing an endless loop that React stops.
Likely causes
  • Writing onClick={setCount(count + 1)} instead of onClick={() => setCount(count + 1)} on a button.
  • Calling a setState function directly in the component body instead of inside an event handler.
Prevention
Trigger state changes from user actions (clicks and form submissions), not while rendering.

Copy for your agent

React stopped with `Too many re-renders`. Find which state update runs during render instead of inside an event handler and fix it.

Full help articleThe app shows a blank or error page on your computer

Last reviewed Nov 8, 2026