import { useEffect , useState } from 'react' ; function useIsMounted ( ) { const [ isMounted , setIsMounted ] = useState < boolean > ( false ) ; useEffect ( ( ) => { setIsMounted ( true ) ; } , [ ] ) ; return isMounted ; } export default useIsMounted ;