Can't load options with Select.Async -


i can't basic application async options loading work. getoptions function gets called select control doesn't display them. here's code , plunkr link https://plnkr.co/edit/vkzxhjqrhdwflmqpt8b5?p=preview

var options = [     { value: 'one', label: 'one' },     { value: 'two', label: 'two' } ];  function logchange(val) {     console.log("selected: " + json.stringify(val)); }  function getoptions(input) {   console.log(input)   return promise.resolve(options) }  reactdom.render(   <select.async     name="form-field-name"     value="one"     loadoptions={getoptions}     onchange={logchange}   />,   document.getelementbyid('example') ); 

i believe need return { options: yourdataarray } instead of yourdataarray.

for example, in code, return promise.resolve(options) should changed return promise.resolve({options})

hope helps.


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -