react-select
react-select copied to clipboard
Provide an example, how to use new Select.Async
"The asyncOptions prop has been replaced by a new wrapper component: Select.Async"
Could you add into documentation an example how to use it?
(found the way)
var Select = require('react-select');
<Select.Async
loadOptions={this.getUsernames}
getUsernames: function(input, callback) {
callback(null, {options: [
thank you for the information, it really hard to found that.
@TrkiSF2 I'm kind of confused on exactly how to use this. For example where do I make my ajax call in the getUsernames function?
I pasted it here.
getUsernames: function(query, callback) { $.get(http://youApi) + '?q=' + Validation.keepAlphaNumeric (query)) .done(function(response) { callback(null, {options: response.usernames}) }); },