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.

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