Description

A name search panel uses memoization to recompute its filtered list only when the search query changes.

Anomaly

Click the Like button - the filter run counter increments even though the search query never changed. After three likes the counter shows 4 runs despite only one query having been entered.

Constraint
Do not remove useMemo
Do not remove the counter button
Hint
Consult the SenseiOnly for those truly stuck · Flip to reveal

useMemo recomputes whenever any value in its dependency array changes - are all listed dependencies actually used inside it?

Loading editor…
Correct Solution
Loading...

Why this fixes it

`likes` was listed in the dependency array but is never read inside the useMemo callback - only `query` is used. Every Like button click updated `likes`, which invalidated the memo and triggered an unnecessary filter recomputation. Removing `likes` from the dependency array means the memo only reruns when `query` actually changes.

Expected OutputGoal State
Your OutputLive