PropTypes is not defined
See original GitHub issueHi, I recently updated from 2.2.1
up to 17.1.2
, and I’ve started getting errors like:
Uncaught ReferenceError: PropTypes is not defined
It seems that the plugin is not adding the import of PropTypes
correctly, maybe? Or is there something else I’m missing? I’m on react 15.4.2
, in case that matters.
Issue Analytics
- State:
- Created 6 years ago
- Comments:16 (10 by maintainers)
Top Results From Across the Web
'Proptypes' is not defined - Stack Overflow
I'm receiving the following linting error 'PropTypes' is not defined. (no-undef) . Here is the code that is causing the issue: import React,...
Read more >propTypes is not defined · Issue #16288 · facebook/react-native
i want use proptypes in my react native- redux projects . but i got the error "propTypes is not defined. in this code:...
Read more >[Solved]-'Proptypes' is not defined-Reactjs - appsloveworld
According to this issue comment. It appears to be because you have installed eslint 4.x when you should just use the eslint version...
Read more >Don't Call PropTypes Warning - React
Don't call PropTypes directly. Using PropTypes in any other way than annotating React components with them is no longer supported: var apiShape =...
Read more >How to Use PropTypes in React - freeCodeCamp
PropTypes are simply a mechanism that ensures that the passed value is of the correct datatype. This makes sure that we don't receive...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
That config option should probably be renamed to ‘forceESModules’ but the behavior is correct. The
'deadCode'
option switches it to userequire
, anduseESModules
overrides that.The import is added by this plugin, but maybe babel is detecting a duplicate import and removing the one we add from the final code? I don’t think this plugin is doing that check, but I’m not sure.
It was removed in 16.0. In 15.5 it was just deprecated