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

Created on 11 Apr 2017  路  3Comments  路  Source: reactjs/react-modal

Summary:

In react 15.5, instead of accessing PropTypes from the main React object, install the prop-types package and import them from there:

Most helpful comment

Strangely, I'm getting this error
Warning: Accessing PropTypes via the main React package is deprecated. Use the prop-types package from npm instead

even after having:

import PropTypes from 'prop-types';

and

Home.propTypes = {
  increment: PropTypes.func,
  count: PropTypes.number
};

Note: I'm having only 1 component in my project. So, that's not isssue.

Issue is linked to: Link

All 3 comments

Ditto, getting this

Fixed in v1.7.4

Strangely, I'm getting this error
Warning: Accessing PropTypes via the main React package is deprecated. Use the prop-types package from npm instead

even after having:

import PropTypes from 'prop-types';

and

Home.propTypes = {
  increment: PropTypes.func,
  count: PropTypes.number
};

Note: I'm having only 1 component in my project. So, that's not isssue.

Issue is linked to: Link

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kinucris picture kinucris  路  3Comments

bjbrewster picture bjbrewster  路  4Comments

petertdinh picture petertdinh  路  4Comments

claydiffrient picture claydiffrient  路  4Comments

gavmck picture gavmck  路  3Comments