Skip to content

Initial value when using asyncOptions? #217

@brianreavis

Description

@brianreavis

What's the correct way to set the initial value of a select when using asyncOptions?

Ideally this is what I'm looking for:

var initialOptions = [{value: "1", label: "One"}];
<Select value="1" options={initialOptions} asyncOptions={...} />

The problem is that the component doesn't play nice with both options and asyncOptions being set. The componentWillReceiveProps method seems to inadvertently reset the options loaded asynchronously with the ones specified as props.

Am I doing something wrong, or do we need to implement an initialOptions prop (like initialValue for regular input elements)?

Related: vschoettke@78845b0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions