We use analytics and advertising cookies to understand how the site is used and whether our ads on Facebook, Instagram and Microsoft search (Bing) work. They are set only if you accept. See our Privacy Policy for details.
Home / Review the AI's PR / TypeScript (React)
The ask: “Debounce the search input by 300 ms and show results for what the user typed.”
Context: React 19 function component; /api/search can take 100-1,500 ms to answer.
Click any added line you would block in review and say why. This change has 2 planted defects.
| 8 | export function SearchBox() { | |
| 9 | const [query, setQuery] = useState(""); | |
| 10 | const [results, setResults] = useState<Result[]>([]); | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + |