React statics with ES6 classes

statics only works with React.createClass. Simply declare the method as a static class method:

class SomeComponent extends React.Component {

  static someMethod() {
    //...
  }

  render() {
    // ...
  }

}

Regarding

React.statics = { ... }

You are literally creating a statics property on the React object. That property does not magically extend your component.

Leave a Comment