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

amorphius picture amorphius  Â·  3Comments

caojinli picture caojinli  Â·  3Comments

timdorr picture timdorr  Â·  3Comments

mickeyreiss-visor picture mickeyreiss-visor  Â·  3Comments

cloudfroster picture cloudfroster  Â·  3Comments