loop with useEffect code example
Example 1: infinite loop useEffect
useEffect(() => {
setIngredients({});
}, []);
Example 2: useeffect infinite loop
//if the value update than it will render agein
useEffect(() => setCount(whatever), [value]);
useEffect(() => {
setIngredients({});
}, []);
//if the value update than it will render agein
useEffect(() => setCount(whatever), [value]);