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