tbleckert / react-select-search

⚡️ Lightweight select component for React
https://react-select-search.com
MIT License
674 stars 149 forks source link

Possible to specify default selected option? #216

Open khughitt opened 2 years ago

khughitt commented 2 years ago

Greetings!

I was wondering if there is a way to indicate which option should be selected and displayed in the input, by default?

Based on an earlier issue, it seems like this should be possible, but I couldn't find any examples of how to achieve this.

I tried:

  1. setting selected="selected" for the default opt, and,
  2. setting the value prop to the value of the desired default

But no luck.

Any suggestions?

Thanks for taking the time to work on this and share it with the community! It's a really useful component :)