medium20 min
Build a Debounced Search
Build a search input that debounces user keystrokes, only triggering a search after the user stops typing for 300ms. Display a list of filtered results and a loading indicator while the debounce timer is active. This teaches effect cleanup and timer management.
Skills
useStateuseEffectdebouncingcleanup
Tests
- Shows all items initially
- Shows "Searching..." indicator while debouncing
- Filters results after debounce delay
- Clears results when input is cleared
Loading editor...