import React from 'react';
import Select from 'react-select';
require("../node_modules/react-select/dist/react-select.css");
const getOptions = (input) => {
return fetch(`/games/uni/autocomplete/${input}`)
.then((response) => {
return response.json();
}).then((json) => {
console.log(json)
return { options: json };
});
}
var SearchBar = React.createClass({
render: function() {
return (
<Select.Async
name="form-field-name"
loadOptions={getOptions} />
)
}
});
export default SearchBar;
console.log(json) is like: ["EA SPORTS FIFA 16", "FIFA 16 Ultimate Team"]
But the suggeestion values are empty
Here the state and props of the component Async
Here the official documentation with the example: https://github.com/JedWatson/react-select#async-options-with-promises
What im missing?

