Description

A search box filters a list of items. Typing a new query should update the visible results. After the first render the filtered list never changes no matter what you type.

Anomaly

Type any letter into the search box — the list stays frozen at the full unfiltered set every time. The input updates but the results never react.

Constraint
Fix only the useMemo dependency array
Do not replace useMemo with useMemo-less inline computation or useEffect
Hint
Consult the SenseiOnly for those truly stuck · Flip to reveal

useMemo memoizes the computed value and only recomputes when its dependencies change. If query is not in the dependency array, the memo is never invalidated

Loading editor…
Correct Solution
Loading...
Expected OutputGoal State
Your OutputLive