Dwight Ware
1 min readDec 20, 2016

--

Nice post. I just wanted to add one more option since you left out my favorite! You can also bind this to click handlers using ES6 class properties and arrow functions. This is essentially the best of all worlds, because it accomplishes the same exact thing as binding handlers in the constructor, but with a much more concise syntax (and it’s also much harder to forget to define your handler function than it is to forget to bind your handler function in the constructor). Example:

--

--

Dwight Ware
0 Followers

Senior Software Engineer @Nvidia.