-
Notifications
You must be signed in to change notification settings - Fork 35
Description
I am trying the async version and and getting the following error:
Uncaught TypeError: Cannot read property 'bind' of undefined
at ./node_modules/core-js-pure/es/instance/bind.js.module.exports (bind.js:6)
Any suggestions?
`class TestComponent extends Component {
constructor(props) {
super(props);
this.state = { repos: [] };
}
getItemsAsync(searchValue, cb) {
let url = https://api.github.com/search/repositories?q=${searchValue}&language=javascript;
fetch(url)
.then(response => {
return response.json();
})
.then(results => {
if (results.items !== undefined) {
let items = results.items.map((res, i) => {
return { id: i, value: res.full_name };
});
this.setState({ repos: items });
cb(searchValue);
}
});
}
render() {
return (
);
}
}
export default TestComponent;`