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 }) { let onSubmit = (/** @type React.FormEvent */ event) => { event.preventDefault(); onSearch(formState.values.search); }; const [formState, { text }] = useFormState(); return (
); } export default SearchBox;