You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 30, 2024. It is now read-only.
However, if your effect is mutating the DOM (via a DOM node ref) and the DOM mutation will change the appearance of the DOM node between the time that it is rendered and your effect mutates it, then you don't want to use useEffect. You'll want to use useLayoutEffect. Otherwise the user could see a flicker when your DOM mutations take effect.
I'd say this is the perfect use case.
The text was updated successfully, but these errors were encountered:
Checks out! I've got this queued up for the next patch-level release, and I've added you to the all contributors list in the README! Thanks for your time here.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
This change will prevent some flickering that I've seen, Kent describes it well here https://kentcdodds.com/blog/useeffect-vs-uselayouteffect:
I'd say this is the perfect use case.
The text was updated successfully, but these errors were encountered: