UNPKG

framer-motion

Version:

A simple and powerful React animation library

16 lines (13 loc) 386 B
import { useRef } from 'react'; import { useIsomorphicLayoutEffect } from './use-isomorphic-effect.mjs'; function useIsMounted() { var isMounted = useRef(false); useIsomorphicLayoutEffect(function () { isMounted.current = true; return function () { isMounted.current = false; }; }, []); return isMounted; } export { useIsMounted };