React Interview_ Why those useEffect hooks are not working as expected
React Interview_ Why those useEffect hooks are not working as expected
Julie J.
·
Follow
3 min read
123
Photo by Caspar Camille Rubin on Unsplash
as expected?
useEffect(() => {
}, 1000);
});
useEffect(() => {
}, 3000);
});
return (
<div className="App">
<p>Counter 1: {count1}</p>
<p>Counter 2: {count2}</p>
</div>
);
}
Expected result
milliseconds).
● The return statement defines the JSX that will be
executed.
intervals.
count2 is still at 0.
Conclusion