Mid-Level
August 19, 2026

Spot the bug: React / Next.js

One snippet. Find the bug, or prove there isn't one.

tsx
1import { useState } from 'react'
2
3function Stepper() {
4  const [count, setCount] = useState(0)
5
6  const incrementBy3 = () => {
7    setCount(count + 1)
8    setCount(count + 1)
9    setCount(count + 1)
10  }
11
12  return (
13    <div>
14      <p>Count: {count}</p>
15      <button onClick={incrementBy3}>+3</button>
16    </div>
17  )
18}

Click the lines that carry the problem.

Your verdict

One attempt per day. The answer shows up right after.

Keep your streak

Create an account to keep your streak and track your progress.

Create an account