Stats

1948 Contributors: 6 Wednesday, June 28, 2017
Licensed under: CC-BY-SA
Not affiliated with Stack Overflow
Rip Tutorial: riptutorial@gmail.com
Roadmap: roadmap

React.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