diff options
author | Vitaly Takmazov | 2019-07-26 15:08:26 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2023-01-13 10:37:55 +0300 |
commit | 050ac675c030b9de6abde874d63c54aaaa80d0d6 (patch) | |
tree | 553efe6bb6cf609ccd92e2de29bff6940a88d4ca /vnext/src/ui/SearchBox.js | |
parent | 7f5b17162587953307c71da1b137e5f416de11bb (diff) |
more jsdoc
Diffstat (limited to 'vnext/src/ui/SearchBox.js')
-rw-r--r-- | vnext/src/ui/SearchBox.js | 12 |
1 files changed, 4 insertions, 8 deletions
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 ( <form onSubmit={onSubmit}> <input name="search" className="text" - placeholder="Search..." value={ formState.values.search } {...text('search')} /> + placeholder="Search..." value={formState.values.search} {...text('search')} /> </form> ); } -SearchBox.propTypes = { - pathname: PropTypes.string.isRequired, - onSearch: PropTypes.func.isRequired, - history: ReactRouterPropTypes.history.isRequired -}; export default withRouter(SearchBox); |