Skip to content

Instantly share code, notes, and snippets.

@WrathChaos
Last active November 7, 2019 20:31
Show Gist options
  • Save WrathChaos/acdf5b27c2bc56a53367f4499ff440d3 to your computer and use it in GitHub Desktop.
Save WrathChaos/acdf5b27c2bc56a53367f4499ff440d3 to your computer and use it in GitHub Desktop.
React Hooks: componentWillUnmount
// Class
componentWillUnmount() {
    console.log('componentWillUnmount');
}

// React Hooks: componentWillUnmount
useEffect(() => {
    return () => console.log('React Hooks: componentWillUnmount');
}, [])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment