question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

I’m getting this error. I believe the warning is originating from either:

a) styled-components b) one of its deps

I’m using create-react-app and my only added dep is styled-components. Removing styled-components makes the warning message go away.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:6
  • Comments:18 (7 by maintainers)

github_iconTop GitHub Comments

3reactions
rovansteencommented, Apr 24, 2017

@k15a this should be fixed in 1.4.5 right? At least that’s what the changelog says, still getting the warning tho.

If I look where it’s coming from: styled-components/lib/types.js which contains the following compiled code:

"use strict";

/* todo: I want this to actually be an array of Function | string but that causes errors */
Object.defineProperty(module.exports, "babelPluginFlowReactPropTypes_proptype_GlamorRule", {
  value: require("react").PropTypes.shape({
    cssText: require("react").PropTypes.string.isRequired
  })
});

/* eslint-disable no-undef */
2reactions
kachkaevcommented, May 2, 2017

@k15a @philpl @geelen could you please reopen this issue meanwhile and even maybe release 1.4.x? There must be thousands of devs who see the warning now 😃

Switching to v2 until it’s stable is something most of us would probably prefer to avoid.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Accessing PropTypes via the main React package is deprecated
Accessing PropTypes via the main React package is deprecated. Use the prop-types package from npm instead. I install. npm i prop-types -S. but ......
Read more >
Warning: Accessing PropTypes via the main React ... - GitHub
Warning : Accessing PropTypes via the main React package is deprecated. Use the prop-types package from npm instead. #366.
Read more >
Warning: Accessing PropTypes via the main React ... - Laracasts
What is this error? Warning: Accessing PropTypes via the main React package is deprecated. Use the prop-types package from npm instead. content.js:5025.
Read more >
[Solved]-Accessing PropTypes via the main React package is ...
Since the release of React v15.5.0 React.PropTypes is deprecated and has moved to another library. You should use npm install prop-types and use...
Read more >
Warning: Accessing PropTypes via the main React package is ...
Warning : Accessing PropTypes via the main React package is deprecated, and will be removed in React v16.0. Use the latest available v15.*...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found