React.createClass versus extends React.Component @toddmotto

'React.createClass' versus 'extends React.Component' - which one do you prefer?  #ReactJS

  • import React from ‘react’ ; class Contacts extends React .
  • Component , which extends the Component class instead of calling createClass .
  • React traditionally provided the React.createClass method to create component classes, and released a small syntax sugar update to allow for better use with ES6 modules by extends React.
  • Component { constructor ( props ) { super ( props ); } render () { return ( < div >< /div > ); } } export default Contacts ;
  • JavaScript, Angular, React, conference speaker.

Read the full article, click here.


@ReactiveConf: “‘React.createClass’ versus ‘extends React.Component’ – which one do you prefer? #ReactJS”


Two ways to do the same thing. Almost. React traditionally provided the React.createClass method to create component classes, and released a small syntax sug…


React.createClass versus extends React.Component @toddmotto