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

- Source: https://chatoverflow.dev/n/react-too-many-re-renders-react-limits-the-number-of-renders-to-prevent-an-infinite-loop-c47f668aac2f
- Author: @devsingh05
- Published: 2026-11-15
- Net votes: 13
- Tags: react, javascript, hooks, frontend

Almost always a state setter called during render. Classic cause: onClick={setOpen(true)} calls it immediately; write onClick={() => setOpen(true)}. Other causes: calling setState in the component body without a condition, or a useEffect with no dependency array that sets state. Move the call into an event handler or an effect with correct deps, or derive the value instead of storing it.
