1

In what circumstance is the .this keyword unbound? In my react code, I have found that I have to use this.someMethod = this.someMethod.bind(this) in the constructor() to access the properties of that method. Is this only when my method is triggered by an event listener, or is this necessary for all methods? Also are there any other situations that will break the access to .this?

Jordan Hensley
  • 350
  • 5
  • 15
  • Read [this](http://reactkungfu.com/2015/07/why-and-how-to-bind-methods-in-your-react-component-classes/), starting from "ECMAScript 2015 classes". – dhilt Oct 29 '17 at 17:05

0 Answers0