
Ask HN: Why Did React Switch to ES6 Classes? - jan-jakub
I tried to find a justification for that change in the API, but couldn&#x27;t find any. Using ES6 Classes in React seems more tedious to me, as I have to bind methods manually, so I see one downside and no upsides. Is it known what was the React guys&#x27; reasoning behind that switch?
======
acemarke
The React team has discussed this many times.

`React.createClass` was created at a time when there were no classes as part
of the JS language itself, and every library was busy inventing its own class-
like inheritance implementation. Now that that classes are an actual part of
the language, they're a common standard of syntax and behavior that tools can
understand, so there's no reason to keep using a homegrown implementation. In
addition, in React 16 the React team will remove `createClass` from the main
React package and move it into a separate package, thus shrinking package
size.

There's a variety of approaches to manage method binding. See the "Using React
with ES6" section of my links list for discussion and information:
[https://github.com/markerikson/react-redux-
links/blob/master...](https://github.com/markerikson/react-redux-
links/blob/master/using-react-with-es6.md)

(I'd normally go dig up some links to comments from the React team, but I'll
leave that as an exercise for the asker this time - trust me, you shouldn't
have to look too hard.)

