CodeAudit
Challenges
Leaderboard
Sign In
Day 1
React Hooks
React Hook Infinite Loop
Click on the lines you believe contain bugs, then submit your answer.
challenge.jsx
1
function Counter() {
2
const [count, setCount] = useState(0);
3
4
useEffect(() => {
5
setCount(count + 1);
6
});
7
8
return <div>{count}</div>;
9
}
Click on lines to flag potential bugs
Submit Review