Skip to content

Instantly share code, notes, and snippets.

@robzlabz
Created January 7, 2021 06:26
Show Gist options
  • Save robzlabz/12a8923467567a50107183fab866eb9b to your computer and use it in GitHub Desktop.
Save robzlabz/12a8923467567a50107183fab866eb9b to your computer and use it in GitHub Desktop.
const FunctionalComponent = () => {
React.useEffect(() => {
return () => {
console.log("dadaaaah");
};
}, []);
return <h1>Selamat tinggal</h1>;
};
class ClassComponent extends React.Component {
componentWillUnmount() {
console.log("dadaaaah");
}
render() {
return <h1>Selamat tinggal</h1>;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment