aboutsummaryrefslogtreecommitdiff
path: root/vnext/src/ui/SearchBox.js
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2019-11-14 13:44:52 +0300
committerGravatar Vitaly Takmazov2023-01-13 10:37:55 +0300
commit841ec978bae3297357c3157a3adf846648771770 (patch)
tree7163d3a814fd68193f04415e5f1aeaf8a2cfd0a4 /vnext/src/ui/SearchBox.js
parent3900358ca6eeac546cbe0eb0bd36572ddc404634 (diff)
react-router-dom hooks
Diffstat (limited to 'vnext/src/ui/SearchBox.js')
-rw-r--r--vnext/src/ui/SearchBox.js10
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;