facebook / prop-types

Runtime type checking for React props and similar objects
MIT License
4.48k stars 356 forks source link

Getting error "undefined is not an object (evaluating '_react.PropTypes.array')" #351

Closed kishanbharda closed 3 years ago

kishanbharda commented 3 years ago

Hello,

I am running the react-native project with the following configuration :

"react": "16.8.3",
"react-native": "0.59.8",

I have installed "prop-types": "^15.7.2",, now when I am running the app I am getting error :

undefined is not an object (evaluating '_react.PropTypes.array')

Can anyone please tell me why this is happening?

ljharb commented 3 years ago

How are you importing this package in your code?

kishanbharda commented 3 years ago

An error was on one of the another library that I have installed. That library using the prop-types and was using old-type imports. So I changed the import type and it's worked.