import React from 'react'; import { withRouter } from 'react-router-dom'; import { useFormState } from 'react-use-form-state'; /** * @param {{ pathname: string, onSearch: function, history: import('history').History }} props */ function SearchBox({ onSearch, history, pathname }) { let onSubmit = (event) => { event.preventDefault(); onSearch(history, pathname, formState.values.search); }; const [formState, { text }] = useFormState(); return (
); } export default withRouter(SearchBox);