react-native-video-player icon indicating copy to clipboard operation
react-native-video-player copied to clipboard

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

Open jainmca21 opened this issue 3 years ago • 2 comments

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.

jainmca21 avatar Jul 14 '22 12:07 jainmca21

Read here: https://github.com/cornedor/react-native-video-player/issues/157

TheDanielMoli avatar Jul 14 '22 12:07 TheDanielMoli

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; },

jatinJV avatar Feb 29 '24 16:02 jatinJV