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.
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.
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
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