import { useForm } from 'react-hook-form' /** * @typedef {object} SearchBoxPropsFields * @property {Function} onSearch */ /** * @typedef {SearchBoxPropsFields} SearchBoxProps */ /** * @param {SearchBoxProps} props */ function SearchBox({ onSearch }) { const { register, handleSubmit } = useForm() /** @type { import('react-hook-form').SubmitHandler } */ let onSubmit = ( values ) => { onSearch(values.search) } return (
) } export default SearchBox