ReactSelect: pass in extra data to be used by custom render
问题 I am using React-Select. Currently I am fetching data from elasticsearch and setting it to state: var new_titles = [] body.hits.hits.forEach(function(obj){ // looping through elasticsearch new_titles.push({value: obj._source.title_id, label: obj._source.title_name}) }) this.setState({titleResults: new_titles}) Later I am using this.state.titleResults and passing it into my React-Select component: <Select autofocus optionComponent={DropdownOptions} options={this.state.titleResults} simpleValue