PATH:
home
/
bkunreyz
/
ezdatarecovery.net
/
wp-content
/
plugins
/
extendify
/
src
/
Launch
/
hooks
import { useEffect } from '@wordpress/element'; export const useWarnOnLeave = (enabled = true) => { // Display warning alert if user tries to exit useEffect(() => { if (!enabled) return; const handleUnload = (event) => { event.preventDefault(); event.returnValue = ''; }; const opts = { capture: true }; window.addEventListener('beforeunload', handleUnload, opts); return () => { window.removeEventListener('beforeunload', handleUnload, opts); }; }, [enabled]); };
[-] useConfetti.js
[edit]
[-] useHomeLayouts.js
[edit]
[-] useFetch.js
[edit]
[-] useSitePlugins.js
[edit]
[-] useTelemetry.js
[edit]
[+]
..
[-] useSiteImages.js
[edit]
[-] useSiteProfile.js
[edit]
[-] usePreviewIframe.js
[edit]
[-] useSiteStyles.js
[edit]
[-] useWarnOnLeave.js
[edit]
[-] useSiteStrings.js
[edit]
[-] useIsMounted.js
[edit]
[-] useSiteLogo.js
[edit]
[-] useSiteQuestions.js
[edit]