use effect change on mount or prop change code example
Example 1: react use effect
useEffect(() => {
},[]);
Example 2: useeffect react
useEffect(() => {
// code goes here
return () => {
// cleanup code codes here
};
},[]);
useEffect(() => {
},[]);
useEffect(() => {
// code goes here
return () => {
// cleanup code codes here
};
},[]);