0
votes

in the react-select component (https://github.com/JedWatson/react-select) what is the way to select an option programmatically?

<Select value={this.state.value}
       onChange={(selOptions) => { this.handleFormChange(selOptions); }}
                        options={this.state.values}
                        isMulti={false}
                      />

If I set the 'value' of the component as one of the values of the array in 'options' nothing is shown as selected.

1

1 Answers

3
votes

The value to be used is the entire object with value and label