React-select: default value is not showing up for Async Options React-Select

Created on 17 Jan 2017  路  2Comments  路  Source: JedWatson/react-select

Hi there,

I tried to use React-Select + Async Options in my project and was not able to make it display value when the page is just loaded.

It is easy to reproduce in the React-Select GithubUsers.js example. If I set default state value to be 872310 (which is Jed Watson GitHub user ID) React-Select will show Select... entry like nothing is selected. Also if I set multi={true} I would be able to see x icon to remove selection but still not value showing in the React Select.

Has anyone faced the same problem by any chance?

Most helpful comment

@anvk
Could you explain what you did further?

All 2 comments

Nevermind. Fixed it by adding initialized: false into state of my component and pulling selected item from API based on the initial value inside of loadOptions following by setting initialized to be true

@anvk
Could you explain what you did further?

Was this page helpful?
0 / 5 - 0 ratings