Mid-Level
November 18, 2026Spot the bug: React / Next.js
One snippet. Find the bug, or prove there isn't one.
tsx
1import { useState, useCallback, memo } from 'react'
2
3const Row = memo(({ label, onClick }: { label: string; onClick: () => void }) => {
4 return <li onClick={onClick}>{label}</li>
5})
6
7function TodoList({ items }: { items: string[] }) {
8 const [selected, setSelected] = useState<string | null>(null)
9
10 const handleClick = useCallback((label: string) => {
11 setSelected(label)
12 }, [selected])
13
14 return (
15 <ul>
16 {items.map(i => <Row key={i} label={i} onClick={() => handleClick(i)} />)}
17 </ul>
18 )
19}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.