Disable React.createClass and PropTypes deprecated warnings in babel react present

React 15.5.0 contain new warnings belong to the changes that are coming on React 16, the warning that you are getting, is actually telling you that you have to implement the new way (since the current way that you are using is going to be deprecated on 16).

React.createClass, you have 2 options, first one is to just use plain JS syntax:

function Welcome(props) {
  return <h1>Hello, {props.name}</h1>;
}

or use the create-react-class module (availiable on npm):

// Before (15.4 and below)
var React = require('react');

var Component = React.createClass({
  mixins: [MixinA],
  render() {
    return <Child />;
  }
});

// After (15.5)
var React = require('react');
var createReactClass = require('create-react-class');

var Component = createReactClass({
  mixins: [MixinA],
  render() {
    return <Child />;
  }
});

About the PropTypes warning, check if you are using module that using PropTypes, sometimes it’s coming from external part.

Anyway, to read more about it, you are welcome to get Facebook blog post about those changes

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)