|
|
|
|
|
by danabramov
3185 days ago
|
|
That's my point: there was no breaking change :-) React.createClass() always did (and still does) autobinding. ES6 classes never supported autobinding. We couldn't have changed your code from one to the other. There is no "release notes" associated with that change—changing the syntax was a conscious decision you made either when converting or when writing a new components. |
|
It can be nearly impossible to Google something if you don't even know what it is that you don't know.
There's a comment by, well, YOU, from March this year[0] on a github issue discussing improvements to documentation, suggesting it is one of the most common troubleshooting issues, so I'm not the only idiot failing to grasp this when first diving into webdev.
It would help tremendously if there was even just a simple sentence in the tutorial like:
> "By the way, we are using an arrow function here because JavaScript has some subtle behaviour when it comes to this, but explaining the details of that here would take too long. See [here], [here] and [here]"
.. with a few links explaining both this and ES6 classes in more detail. Because otherwise you can easily get stuck not even knowing where to look for the cause of the bug.
[0] https://github.com/facebook/react/issues/8060#issuecomment-2...