sickdyd / react-search-autocomplete

A search box that filters the provided array of objects
https://sickdyd.github.io/react-search-autocomplete
MIT License
218 stars 82 forks source link

handleOnSearch is unclear #67

Closed OmniscienceAcademy closed 2 years ago

OmniscienceAcademy commented 2 years ago

handleOnSearch is unclear. We do not understand what the result parameter is used for

// onSearch will have as the first callback parameter
// the string searched and for the second the results. <-- What does this mean? 

I do not understand what you mean by results. Thanks

sickdyd commented 2 years ago

@OmniscienceAcademy onSearch is called every time you type text. Every time you type there are potential results, those are returned along with the string searched. It could be an empty array if there are no results from the string searched. Let me know if this helps.

sickdyd commented 2 years ago

I hope the above answer resolves the issue. I will close this for now.