← Snippets

useMountLog Hook

1function useMountLog(componentName) {
2 React.useEffect(() => {
3 console.warn(`useMountLog: ${componentName} Mounted`)
4 return () => {
5 console.warn(`useMountLog: Unmounted ${componentName}`)
6 }
7 }, [])
8}
9
Site Logo - Andrew Lazenka
© 2021 Andrew Lazenka. All Rights Reserved.