Skip to content

Conversation

@eps1lon
Copy link
Member

@eps1lon eps1lon commented Nov 26, 2025

preview: useEffect reference docs

I had two instances recently where people were confused by useEffect not running after each render (facebook/react#35221 and facebook/react#34730). I think the docs aren't super clear about this and you need a bit of a React brain to infer the actual behavior.

In the learn section where we introduce the render and commit phase, we don't talk about Effects: https://react.dev/learn/render-and-commit. That seems fine to me since Effects are an advanced concept.

However, the useEffect reference docs, say that the setup runs after "render" not after "commit": https://react.dev/reference/react/useEffect#parameters

I went through all mentions of render in the Effect reference docs and replaced it with "commit" when it talked about the timing of the Effect execution.

@meta-cla meta-cla bot added the CLA Signed label Nov 26, 2025
---
### My Effect runs after every re-render {/*my-effect-runs-after-every-re-render*/}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I kept this as "re-render" instead of commit since I suspect people troubleshooting this particular issue search more often with "render" than commit.

@eps1lon eps1lon marked this pull request as ready for review November 26, 2025 11:07
@eps1lon eps1lon merged commit cffb6a7 into reactjs:main Dec 11, 2025
2 checks passed
@eps1lon eps1lon deleted the sebbie/11-26-specify_that_effects_run_on_commit_not_render branch December 11, 2025 06:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant