basic useeffect cleanup in context code example
Example: useeffect with cleanup
useEffect(() => {
//your code goes here
return () => {
//your cleanup code codes here
};
},[]);
useEffect(() => {
//your code goes here
return () => {
//your cleanup code codes here
};
},[]);