|
|
|
|
|
by acemarke
3361 days ago
|
|
It's worth noting that the React team promotes composition over inheritance, and discourages any levels of inheritance past `class MyComponent extends React.Component`. Long term, the React team plans to investigate concepts like "stateful functional components", but until then, classes are the most straightforward way of having lifecycles. The existence of ES6 classes is based on the wide range of third-party "class" implementations across the JS ecosystem, so clearly there was a desire to have them available. Since they're available, React is using them. |
|
Huh? Why? React.createClass({}) is/was pretty straightforward. What is more straightforward about classes? All I see is more code.