react function runs several times code example
Example: react function runs several times
useEffect(() => {
<fn name>();
}, []); // This array at end stops the fn from being called several times
useEffect(() => {
<fn name>();
}, []); // This array at end stops the fn from being called several times