A search box filters a list. Typing a new query should update the results. After the first keystroke the results never change again
Type one character — the list filters correctly. Type a second character — the list does not update. The results are frozen after the first change.
The effect that runs the filter captures the query value at the time it was created. If query is not in the dependency array, the effect never re-runs when query changes.
The effect that runs the filter captures the query value at the time it was created. If query is not in the dependency array, the effect never re-runs when query changes.