()
| 3 | import SearchResults from './SearchResults' |
| 4 | |
| 5 | export default function Search() { |
| 6 | const [query, setQuery] = React.useState('') |
| 7 | |
| 8 | const handleOnChange = (event: React.ChangeEvent<HTMLInputElement>) => { |
| 9 | event.preventDefault() |
| 10 | // It is recommended to debounce this event in prod |
| 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={query} /> |
| 22 | </div> |
| 23 | ) |
| 24 | } |
nothing calls this directly
no outgoing calls
no test coverage detected