Personally I like to use a function for that, but every time I open the docs to copy the code, which is probably "componentWillUnmount" long, it showed me the ES6 syntax. So no choice.
While React.createClass gives us a lot of pleasantries like binding the this keyword for us, I like promoting the JavaScript language itself and by using ES6 syntax, seems the React team is heading in this direction too.
Personally I like to use a function for that, but every time I open the docs to copy the code, which is probably "componentWillUnmount" long, it showed me the ES6 syntax. So no choice.