'Implementing default suggestions when input is focused

I am using the react-autosuggest library to implement auto-suggestions functionality. I am pretty new to using this library. I went through the documentation, but it seems to be a bit confusing to me in certain things. I tried to find answers to a few of the things:

  1. What is the complete list of inputProps that can be passed to the component?
  2. How can we open a dropdown with a list of a few default suggestions as soon as the user clicks on the input box instead of showing suggestions only when the user types in?
  3. What exactly is the use of prop: multiSection when the data is of the form [{ name: '', flag: ''}] (just a sample) and we display only name in the dropdown list?

I found a lot of similar working examples using this library but wasn't able to get hold of the understanding properly. Seems like there are lots of missing points in the library documentation.

I found this one basic clean working snippet: https://codesandbox.io/s/react-autosuggest-example-with-hooks-forked-y7lkom. But was unable to add the dropdown functionality to it.

If anyone can help to get through this feature and some above queries, I would be highly thankful.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source