@@ -67,11 +67,11 @@ function App() {
6767``` jsx 
6868import  { useSearch  } from  ' react-search-hook' 
6969function  MyExampleComponent () {
70-   const  { search ,  setSearch  } =  useSearch (' products' 
70+   const  { register  } =  useSearch (' products' 
7171
7272  return  (
7373    < div> 
74-       < input onChange = {( e )  =>   setSearch ( e . target . value )} / > 
74+       < input { ... register ( )} / > 
7575      < span> {search}< / span> 
7676    < / div> 
7777  )
@@ -86,11 +86,11 @@ function MyExampleComponent() {
8686import  { useSearch  } from  ' react-search-hook' 
8787function  MyExampleComponent () {
8888  const  items  =  [' text1' ' text2' ... ]
89-   const  { search ,  setSearch , searchResult  } =  useSearch (' products' 
89+   const  { register , searchResult  } =  useSearch (' products' 
9090
9191  return  (
9292    < div> 
93-       < input onChange = {( e )  =>   setSearch ( e . target . value )} / > 
93+       < input { ... register ( )} / > 
9494      {searchResult .map ((item , key ) =>  (
9595        < li> {JSON .stringify (item)}< / li> 
9696      ))}
@@ -115,6 +115,15 @@ function MyExampleComponent() {
115115|  items      |  array of strings or objects |                             |  The array of strings or objects to be filtered                             | 
116116|  searchProp |  string                      |  yes if each item is object |  If each item is an object, it specifies the desired property of the filter | 
117117
118+ #### useSearch responses  
119+ 
120+ |  Name         |  Type           |  Description                                                                                                | 
121+ |  ------------ |  -------------- |  ---------------------------------------------------------------------------------------------------------- | 
122+ |  seach        |  string         |  The current value of the specified store                                                                   | 
123+ |  setSearch    |  function       |  function that updates the specified store                                                                  | 
124+ |  register     |  function       |  This function returns an object with properties required for registering an input                          | 
125+ |  searchResult |  array of items |  If options include items (and a search property for array of objects), items will filter with search value | 
126+ 
118127## Contributor ✨  
119128
120129[ ![ Contributors] ( https://contrib.rocks/image?repo=DevAnsar/react-search-hook )] ( https://github.com/DevAnsar/react-search-hook/graphs/contributors ) 
0 commit comments