import { useEffect, useLayoutEffect, useRef } from "react";
const useIsomorphicLayoutEffect = "u" > typeof window ? useLayoutEffect : useEffect;
function useLatestRef(value) {
    const ref = useRef(value);
    useIsomorphicLayoutEffect(()=>{
        ref.current = value;
    }, [
        value
    ]);
    return ref;
}
export { useLatestRef };
