react-select icon indicating copy to clipboard operation
react-select copied to clipboard

Provide an example, how to use new Select.Async

Open EnchanterIO opened this issue 11 years ago • 3 comments

"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: [

EnchanterIO avatar Nov 07 '15 22:11 EnchanterIO

thank you for the information, it really hard to found that.

lanmengyujing avatar Nov 23 '15 09:11 lanmengyujing

@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?

akhayoon avatar Jan 06 '16 16:01 akhayoon

I pasted it here.

getUsernames: function(query, callback) { $.get(http://youApi) + '?q=' + Validation.keepAlphaNumeric (query)) .done(function(response) { callback(null, {options: response.usernames}) }); },

EnchanterIO avatar Jan 07 '16 03:01 EnchanterIO