What counts as a side effect in React?
Anything that reaches outside the render: data fetching, subscriptions, direct DOM manipulation, timers, logging, and reading from or writing to external stores. These do not belong in the render body.
Verify This Answer
Cross-check this information using these trusted sources:
More FAQs in Rendering vs Side Effects: Understanding the React Mental Model
Rendering is the pure process of describing the UI from state and props. Side effects are anything that reaches outside the render, like fetching, subscribing, or DOM manipulation. Rendering should be pure; side effects belong in useEffect.
Because React relies on render being predictable. Given the same state, render should produce the same output with no external changes. This lets React safely re-render and reconcile without surprises or bugs.
In useEffect, event handlers, or other dedicated places, never directly in the render body. Performing side effects during render causes them to run on every render, leaks, and inconsistent state.
Still have questions?
Browse all our FAQs or reach out to our support team
