- Searched for“useResults”3 results
- Readcomponents/search.tsx18 lines
Every keystroke calls useResults, and it fetches right away. Typing react sends five requests and renders five result lists, which is what your profile shows.
Debounce the value, not the handler:
- The input stays instant because it still updates on every key.
- The search waits for a short pause, so one request goes out instead of five.
Then pass useDebouncedValue(query, 250) to useResults instead of query.
Nova 3 · Medium