()
| 3 | import SearchResults from './SearchResults' |
| 4 | |
| 5 | export default function Search() { |
| 6 | const [query, setQuery] = React.useState('') |
| 7 | const [debouncedQuery] = useDebouncedValue(query, { wait: 300 }) |
| 8 | |
| 9 | const handleOnChange = (event: React.ChangeEvent<HTMLInputElement>) => { |
| 10 | event.preventDefault() |
| 11 | setQuery(event.target.value) |
| 12 | } |
| 13 | |
| 14 | return ( |
| 15 | <div> |
| 16 | <input |
| 17 | onChange={handleOnChange} |
| 18 | value={query} |
| 19 | placeholder="Search products" |
| 20 | /> |
| 21 | <SearchResults query={debouncedQuery} /> |
| 22 | </div> |
| 23 | ) |
| 24 | } |
nothing calls this directly
no outgoing calls
no test coverage detected