Skip to content

Bind error #28

@moniqueboea

Description

@moniqueboea

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;`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions