From 841ec978bae3297357c3157a3adf846648771770 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Thu, 14 Nov 2019 13:44:52 +0300 Subject: react-router-dom hooks --- vnext/src/ui/SearchBox.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'vnext/src/ui/SearchBox.js') 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)} */ 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; -- cgit v1.2.3