use useeffect in unmount code example
Example 1: useeffect umnount
useEffect(() => {
return () => {
console.log("cleaned up");
};
}, []);
Example 2: react useEffect
import React, { useEffect } from 'react';
export const App: React.FC = () => {
useEffect(() => {
}, [/*Here can enter some value to call again the content inside useEffect*/])
return (
<div>Use Effect!</div>
);
}