Created
January 5, 2023 06:40
-
-
Save hujuu/65f8b3894ce73d7771a90e2c5db9d49f to your computer and use it in GitHub Desktop.
algoliaのカスタムサーチボックス
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import { useSearchBox } from "react-instantsearch-hooks-web"; | |
export function CustomSearchBox({ props }: { props: any }) { | |
const { query, refine } = useSearchBox(props); | |
return ( | |
<> | |
<input | |
type="text" | |
value={query} | |
placeholder="Common name or scientific name" | |
onChange={(e) => refine(e.currentTarget.value)} | |
/> | |
</> | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment