react.dev
react.dev copied to clipboard
[Typo]: Possible incorrect info
trafficstars
Summary
In here: https://react.dev/reference/react/useLayoutEffect#parameters it says:
Before your component is added to the DOM, React will run your setup function
This seems to be incorrect
Page
https://react.dev/reference/react/useLayoutEffect#parameters
Details
No response
It runs after mutations but before paint. I guess this is technically after it's added to the DOM, which is relevant since if you're going to read layout (the purpose of the API) you need it to be after mutations. But I guess it depends on whether "added to the DOM" includes paint. @gaearon what did you mean here?