setstate in useeffect infinite loop handle react js hoook code example
Example: useeffect infinite loop
//if the value update than it will render agein
useEffect(() => setCount(whatever), [value]);
//if the value update than it will render agein
useEffect(() => setCount(whatever), [value]);