ReactReact.createClass vs extends React.Component

Syntax

  • Case 1: React.createClass({ })
  • Case 2: class MyComponent extends React.Component { }

Remarks

React.createClass was deprecated in v15.5 and expected to be removed in v16. There is a drop-in replacement package for those that still require it. Examples using it should be updated.

Related Examples