Skip to content

react/prefer-es6-class Style ​

What it does ​

React offers you two ways to create traditional components: using the ES5 create-react-class module or the new ES6 class system.

Why is this bad? ​

This rule enforces a consistent React class style.

Example ​

jsx
var Hello = createReactClass({
  render: function () {
    return <div>Hello {this.props.name}</div>;
  },
});

References ​

Released under the MIT License.