react.dev icon indicating copy to clipboard operation
react.dev copied to clipboard

[Typo]: Possible incorrect info

Open xivilai opened this issue 1 year ago • 1 comments
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

xivilai avatar Mar 02 '24 13:03 xivilai

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?

rickhanlonii avatar Mar 03 '24 22:03 rickhanlonii