Seeking clarification on the meaning of 'this' in this context. Why do I need to bind 'this' to the callback after the ajax request? When I check the debugger, it says 'this' is bound to the constructor whether I call bind or not.
var BugList = React.createClass({
getInitialState: function() {
return {
bugs: []
}
},
componentDidMount: function() {
$.ajax('/api/bugs').done(function(data) {
this.setState({
bugs: JSON.parse(data)
});
}.bind(this));
},