react.dev
react.dev copied to clipboard
Missing info about changes in StrictMode discoverable through useEffect docs
This ticket was originally reported in the React issue as a potential bug: https://github.com/facebook/react/issues/24502
After a short discussion with @gaearon I volunteered to update the docs so that once someone learns about empty dependencies array in useEffect
simulating componentDidMount
they won't be surprised to see effect callback run twice on mount.
@gaearon I know you guys are working really hard on moving beta.reactjs.org out of "beta" but is there a chance this little improvement to the old useEffect
docs will get merged? 🥺 (You asked for it in May: https://github.com/facebook/react/issues/24502#issuecomment-1121516947)