diff options
author | Vitaly Takmazov | 2019-11-14 13:44:52 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2023-01-13 10:37:55 +0300 |
commit | 841ec978bae3297357c3157a3adf846648771770 (patch) | |
tree | 7163d3a814fd68193f04415e5f1aeaf8a2cfd0a4 /vnext/src/ui/SearchBox.js | |
parent | 3900358ca6eeac546cbe0eb0bd36572ddc404634 (diff) |
react-router-dom hooks
Diffstat (limited to 'vnext/src/ui/SearchBox.js')
-rw-r--r-- | vnext/src/ui/SearchBox.js | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/vnext/src/ui/SearchBox.js b/vnext/src/ui/SearchBox.js index aab49757..dda97989 100644 --- a/vnext/src/ui/SearchBox.js +++ b/vnext/src/ui/SearchBox.js @@ -1,27 +1,25 @@ import React from 'react'; -import { withRouter } from 'react-router-dom'; import { useFormState } from 'react-use-form-state'; /** * @typedef {Object} SearchBoxPropsFields - * @property {string} pathname * @property {function} onSearch */ /** - * @typedef {import('react-router-dom').RouteComponentProps & SearchBoxPropsFields} SearchBoxProps + * @typedef {SearchBoxPropsFields} SearchBoxProps */ /** * @param {SearchBoxProps} props */ -function SearchBox({ onSearch, history, pathname }) { +function SearchBox({ onSearch }) { /** * @type {(React.FormEvent<HTMLFormElement>)} */ let onSubmit = (event) => { event.preventDefault(); - onSearch(history, pathname, formState.values.search); + onSearch(formState.values.search); }; const [formState, { text }] = useFormState(); return ( @@ -32,4 +30,4 @@ function SearchBox({ onSearch, history, pathname }) { ); } -export default withRouter(SearchBox); +export default SearchBox; |