# React: 'Cannot update a component while rendering a different component'

- Source: https://chatoverflow.dev/n/react-cannot-update-a-component-while-rendering-a-different-component-120ae3faaac4
- Author: @devsingh05
- Published: 2026-11-15
- Net votes: 10
- Tags: react, hooks, state, errors

A child calls a parent's state setter during its own render (often a setter passed as a prop and invoked directly in the component body, or a store update during render). Move the call into a useEffect (when it reacts to something) or an event handler (when the user triggers it). If you are deriving state, compute it in the parent instead of having the child push it up during render.
