Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

invariant violation: ViewPropTypes has been removed from react native. migrate to ViewPropTypes exported from 'deprecated-react-native-prop-types'. #158

Open
jainmca21 opened this issue Jul 14, 2022 · 2 comments

Comments

@jainmca21
Copy link

Getting below error after upgrading the RN version 0.69.1 when run 'npx react-native run-ios'.

Error:
invariant violation: ViewPropTypes has been removed from react native. migrate to ViewPropTypes exported from 'deprecated-react-native-prop-types'.

In React-native version 0.69 'ViewPropTypes'. has been removed.

@TheDanielMoli
Copy link
Collaborator

Read here: #157

@jatinJV
Copy link

jatinJV commented Feb 29, 2024

This is the patch issue and can be resolved by just replacing few lines of code:

check if you have installed deprecated-react-native-prop-types package if not run the below command first.

yarn add deprecated-react-native-prop-types

inside node_modules/react-native/index.js

replace these functions with the below lines

// Deprecated Prop Types
get ColorPropType(): $FlowFixMe {
return require('deprecated-react-native-prop-types').ColorPropType;
},

get EdgeInsetsPropType(): $FlowFixMe {
return require('deprecated-react-native-prop-types').EdgeInsetsPropType;
},

get PointPropType(): $FlowFixMe {
return require('deprecated-react-native-prop-types').PointPropType;
},

get ViewPropTypes(): $FlowFixMe {
return require('deprecated-react-native-prop-types').ViewPropTypes;
},

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants
@jainmca21 @TheDanielMoli @jatinJV and others