wikan wicaksono
wikan wicaksono

Reputation: 51

Prop `aria-activedescendant` did not match. react-select

i recently use react-select and its giving me an error which is :

Proparia-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

Answers (1)

Jorge Iten Jr
Jorge Iten Jr

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

Related Questions