useeffect with cleanup code example
Example 1: react use effect
useEffect(() => {
},[]);
Example 2: useeffect with cleanup
useEffect(() => {
//your code goes here
return () => {
//your cleanup code codes here
};
},[]);
useEffect(() => {
},[]);
useEffect(() => {
//your code goes here
return () => {
//your cleanup code codes here
};
},[]);