Arrow
The ES2015 specification introduces thearrow function syntaxfor writing function expressions. As well as being terser than regular function expressions, they can also have implicit return and most importantly, they always use the value of
this
from the enclosing scope.
Bind this
React allows you to define arbitrary methods on your component classes and these methods are automatically bound with the correct context for
this
when you create your components withReact.createClass
. This allows you move your callback code out onto your component.