react component destroy hook code example
Example: useeffect umnount
useEffect(() => {
return () => {
console.log("cleaned up");
};
}, []);
useEffect(() => {
return () => {
console.log("cleaned up");
};
}, []);