MCPcopy Create free account
hub / github.com/TanStack/query / Search

Function Search

examples/solid/algolia/src/Search.tsx:6–27  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4import type { JSX } from 'solid-js'
5
6export default function Search() {
7 const [query, setQuery] = createSignal('')
8 const [debouncedQuery] = createDebouncedValue(query, { wait: 300 })
9
10 const handleOnInput: JSX.EventHandler<HTMLInputElement, InputEvent> = (
11 event,
12 ) => {
13 event.preventDefault()
14 setQuery(event.currentTarget.value)
15 }
16
17 return (
18 <div>
19 <input
20 onInput={handleOnInput}
21 value={query()}
22 placeholder="Search products"
23 />
24 <SearchResults query={debouncedQuery()} />
25 </div>
26 )
27}

Callers

nothing calls this directly

Calls 1

queryFunction · 0.50

Tested by

no test coverage detected