Created
January 13, 2022 08:16
-
-
Save longseespace/f5ab22f9264d3d40b05e722c12eb5b67 to your computer and use it in GitHub Desktop.
Revisions
-
longseespace created this gist
Jan 13, 2022 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,7 @@ import { useMountDebug } from './useMountDebug'; function SignInForm(props) { useMountDebug('SignInForm'); return (<div></div>) } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,10 @@ import { useEffect } from 'react'; export function useMountDebug(label = 'Component') { useEffect(() => { console.log(label, 'mounted'); return () => { console.log(label, 'unmounted'); }; }, []); }