Created
May 23, 2022 11:27
-
-
Save alpavlove/8d7b906cc26ba1ccfa8820ca6461a194 to your computer and use it in GitHub Desktop.
React Hooks instead of lifecycle methods - useEffect hook instead of componentWillUnmount
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 characters
useEffect(() => { | |
// to do smth... | |
return () => { | |
// to do smth else when a component is unmounted... | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment