Redux: Warning: Accessing PropTypes via the main React package is deprecated. Use the prop-types package from npm instead.

Created on 8 Apr 2017  路  2Comments  路  Source: reduxjs/redux

We need update <Provider /> prop types for React v 15.0.0

https://facebook.github.io/react/blog/2017/04/07/react-v15.5.0.html

// Before (15.4 and below)
import React from 'react';

class Component extends React.Component {
  render() {
    return <div>{this.props.text}</div>;
  }
}

Component.propTypes = {
  text: React.PropTypes.string.isRequired,
}

// After (15.5)
import React from 'react';
import PropTypes from 'prop-types';

class Component extends React.Component {
  render() {
    return <div>{this.props.text}</div>;
  }
}

Component.propTypes = {
  text: PropTypes.string.isRequired,
};

Most helpful comment

Please file it in react-redux, this is not the right repository. Thanks!

All 2 comments

Oh... sorry. it's warning in react-redux package

Please file it in react-redux, this is not the right repository. Thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ronag picture ronag  路  46Comments

gaearon picture gaearon  路  61Comments

erikras picture erikras  路  63Comments

EricSimons picture EricSimons  路  45Comments

wmertens picture wmertens  路  55Comments