1

I have such error in React Native project,

Undefined is not an object (evaluating '_react.PropTypes.number'

I have new import of PropTypes in all project. Any ideas how to solve this issue?

enter image description here

1 Answer 1

2

React.PropTypes has been moved from react package to prop-types package, you're probably using an outdated third party component that havn't made the necessary updates.

Edit : if this error is from your PropTypes declaration you have to use PropTypes.number instead of React.PropTypes.number

Sign up to request clarification or add additional context in comments.

3 Comments

And how to found it in the project? I have searched in all project for the old import of PropTypes (import {PropTypes} from 'react';) and there was 0 matches, the same as 0 matches for React.PropTypes.number.
You have to search in your node_modules too
But it may have different syntax with spaces... You should try to identify what module is wrong by removing imports until it works or maybe you can find it by reading the error.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.