I'm a beginner in React.JS and trying to figure out what the advantages of the newer approach with "class SimpleComponent extends Component{}" towards "React.createClass()" is. Would be great if someone can explain me that :-)
1 Answer
Because React.createClass({...}) is deprecated as of April 2017.
When React was initially released, there was no idiomatic way to create classes in JavaScript, so we provided our own: React.createClass.
Later, classes were added to the language as part of ES2015, so we added the ability to create React components using JavaScript classes. Along with functional components, JavaScript classes are now the preferred way to create components in React.