Invariant Violation: ViewPropTypes has been removed from React Native. Migrate to ViewPropTypes exported from 'deprecated-react-native-prop-types'.
mayurkapare opened this issue ยท 8 comments
"react-native": "0.69.1",
"react-native-youtube": "^2.0.2",
+1 getting same error
Facing same issue
"dependencies": {
"react": "18.0.0",
"react-native": "0.69.1",
"react-native-youtube": "^2.0.2"
},
I faced the same issue and did the following to solve it :
1- remove react-native-youtube
**yarn remove react-native-youtube **
2- install react-native-youtube version 2.0.0
** yarn add react-native-youtube@2.0.0**
3- from your root project go to the lib folder
cd node_modules/react-native-youtube
4- install deprecated-react-native-prop-types
** npm i deprecated-react-native-prop-types**
5- for files "YouTube.android.js" and "YouTube.ios.js"
replace import { ViewPropTypes } from 'react-native';
with import { ViewPropTypes } from 'deprecated-react-native-prop-types';
Hope is helpful
The above is not a permanent solution enough to get it work
@AbdelrhmanFathy thank you very much
use react-native 0.68 version ๐
The above is not a permanent solution enough to get it work
Use the patch-package. It allows you to modify files in any library and memorize this changes, so that every time you run yarn install
, these fixes will be applied.
I hope this will be fixed in the react-native-youtube
library someday...