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
thisfrom the enclosing scope.
React allows you to define arbitrary methods on your component classes and these methods are automatically bound with the correct context for
thiswhen you create your components with
React.createClass. This allows you move your callback code out onto your component.