D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
diafdxji
/
sbaitraiteur.com
/
wp-content
/
plugins
/
extendify
/
src
/
Launch
/
hooks
/
Filename :
useIsMounted.js
back
Copy
import { useRef, useEffect, useLayoutEffect } from '@wordpress/element'; export const useIsMounted = () => { const isMounted = useRef(false); useEffect(() => { isMounted.current = true; return () => (isMounted.current = false); }); return isMounted; }; export const useIsMountedLayout = () => { const isMounted = useRef(false); useLayoutEffect(() => { isMounted.current = true; return () => (isMounted.current = false); }); return isMounted; };