CONTACT US

    useEffect vs useLayoutEffect

    A person stands near a large, bright fire at night, with sparks flying and glowing embers illuminating the scene against a dark background.
    • useLayoutEffect: If you need to mutate the DOM and/or DO need to perform measurements
    • useEffect: If you don’t need to interact with the DOM at all or your DOM changes are unobservable.

     

    Article link copied

    Close button