Skip to content

Instantly share code, notes, and snippets.

@hujuu
Created January 5, 2023 06:40
Show Gist options
  • Save hujuu/65f8b3894ce73d7771a90e2c5db9d49f to your computer and use it in GitHub Desktop.
Save hujuu/65f8b3894ce73d7771a90e2c5db9d49f to your computer and use it in GitHub Desktop.
algoliaのカスタムサーチボックス
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