Gonzalo Muro5,281 Points
I dont understand yet what is the .bind(this) function for. Can you explain that to me please?
In the "Handling Events" section of the React Documentation, says the following:
// This binding is necessary to make
this work in the callback
this.handleClick = this.handleClick.bind(this);
, but why?
Is it because if we don't do that "this" will access only to his own scope (handleClick function) instead of the component scope?