Reputation: 51
i recently use react-select and its giving me an error which is :
Prop
aria-activedescendantdid not match
i just copy and paste the example in the github pages its working well except this error warning.
this is my code
<Select
name={this.props.name}
value={this.state.selectedOption}
onChange={this.handleChange}
options={[
{ value: 'one', label: 'One' },
{ value: 'two', label: 'Two' },
]}
/>
Upvotes: 5
Views: 2711
Reputation: 362
After a look at the source code, I found out if you don't pass the prop instanceId
react-select generates a new one. So, in order to get rid of the warning pass the prop.
<Select
name={this.props.name}
instanceId={this.props.name}
value={this.state.selectedOption}
onChange={this.handleChange}
options={[
{ value: 'one', label: 'One' },
{ value: 'two', label: 'Two' },
]}
/>
Upvotes: 0