3 ms·
From my perspective, the sequence was: - From 2008-2014, _everyone_ was writing their own "class-like" abstractions (see: Backbone, Class.js, five million othe
by acemarke 6y ago
From my perspective, the sequence was:
- From 2008-2014, _everyone_ was writing their own "class-like" abstractions (see: Backbone, Class.js, five million other "inheritance" libs). So, the React team wrote `createClass` as their own implementation.
- When ES6 classes came out, the React team took that as an opportunity to drop maintaining their own abstraction and switch to something that was actually standardized, and reduce the amount of magic behavior (auto-binding, mixins, etc).
- Function components came out in React 0.14, and were initially limited to just rendering based on props - no state or effects possible
- Hooks now give function components the ability to have state and effects. In addition, encouraging a move away from classes dovetails into the React team's long-term plans for the React APIs.
- lucideer 6y agoYeah, great rundown. The class abstractions added to ES spec. didn't happen in a vacuum; it was very much on the back of community demand. Backbone especially had an outsized influence. Perhaps that was a necessary step toward realising tools to solve problems without those abstractions, I don't know.