I am new at ReactJS, and I encounter some problems.
I also learned about the ES6
syntax, and it said the following codes are the same meaning.
1.
YTSearch({key: API_KEY, term: 'nba'}, function(videos) {
this.setState({ videos });
});
2.
YTSearch({key: API_KEY, term: 'nba'}, (videos) => {
this.setState({ videos });
});
However, the first way threw this error
TypeError: Cannot read property 'setState' of undefined