import React from 'react'; import { useFormState } from 'react-use-form-state'; /** * @typedef {Object} SearchBoxPropsFields * @property {function} onSearch */ /** * @typedef {SearchBoxPropsFields} SearchBoxProps */ /** * @param {SearchBoxProps} props */ function SearchBox({ onSearch }) { /** * @type {(React.FormEvent)} */ let onSubmit = (event) => { event.preventDefault(); onSearch(formState.values.search); }; const [formState, { text }] = useFormState(); return (
); } export default SearchBox;