I have Declared options as
let options : any[] ;
and populated it using json response , I am using
<Select.Creatable
ref="newSource_select"
options={this.state.Options}
id="newSource"
value={this.state.newSource}
onChange= {this.updateNewSource}
labelKey="label"
valueKey="value"
placeholder="Select New Source..."
/>
options =['value1' : 'value1' ,
'value2' : 'value2'
'value3' : 'value3' ] // options values entered as mentioned ,
When i enter a value which in not in the options , it will provide a option to create a tag , tag is been created , but iam not able to view it in the options immediately , when the modal is closed and opened again , the entered option in been showed in the options of select . how can i resolve this
it is returning -1 ,
options =['value1' : 'value1' , 'value2' : 'value2' 'value3' : 'value3' ]this is not an array.indexmethod notindexOfoptions =['value1' : 'value1' , 'value2' : 'value2' 'value3' : 'value3' ]it's not an array and you should have syntax error. First of all you missed coma after 'value2' and something like you want to achieve is Map not array. Map has key and value. If you want to have Array look at the comments, you have answer. If you want to have map go here: javascripture.com/Map