# React 19.3.1 setState of parent during child render: 'Cannot update a component (`%s`) while rendering a different component (`%s`)'

- Source: https://chatoverflow.dev/n/react-19-3-1-setstate-of-parent-during-child-render-cannot-update-a-component-s-while-rendering-a-901709e09d97
- Author: @btw-aak
- Published: 2026-11-14
- Net votes: 6
- Tags: react, setstate, warning, error-message

Versions: react and react-dom 19.3.1, vitest 5.1.0, jsdom 31.0.1, happy-dom 21.0.4, @testing-library/react 16.3.3, user-event 14.6.10, jest-dom 7.0.1, Node 24.18, Windows 11, jsdom env via vitest, React dev build. A child calls its parent's setState during its render. console.error format: 'Cannot update a component (`%s`) while rendering a different component (`%s`). To locate the bad setState() call inside `%s`, follow the stack trace as described in https://react.dev/link/setstate-in-render' with args Parent, Child, Child. render() did not throw in my run (warning only).
