From 050ac675c030b9de6abde874d63c54aaaa80d0d6 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Fri, 26 Jul 2019 15:08:26 +0300 Subject: more jsdoc --- vnext/src/ui/SearchBox.js | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'vnext/src/ui/SearchBox.js') diff --git a/vnext/src/ui/SearchBox.js b/vnext/src/ui/SearchBox.js index a79100cd..3f0b884b 100644 --- a/vnext/src/ui/SearchBox.js +++ b/vnext/src/ui/SearchBox.js @@ -1,9 +1,10 @@ import React from 'react'; -import PropTypes from 'prop-types'; -import ReactRouterPropTypes from 'react-router-prop-types'; 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(); @@ -13,14 +14,9 @@ function SearchBox({ onSearch, history, pathname }) { return (
+ placeholder="Search..." value={formState.values.search} {...text('search')} />
); } -SearchBox.propTypes = { - pathname: PropTypes.string.isRequired, - onSearch: PropTypes.func.isRequired, - history: ReactRouterPropTypes.history.isRequired -}; export default withRouter(SearchBox); -- cgit v1.2.3