react-native-youtube
react-native-youtube copied to clipboard
Invariant Violation: ViewPropTypes has been removed from React Native. Migrate to ViewPropTypes exported from 'deprecated-react-native-prop-types'.
"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 [email protected]**
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...
it was fixed using this PR https://github.com/davidohayon669/react-native-youtube/pull/538 but the new version never got released. I don't see these changes in version 2.0.2 which was release 3 years ago and then no version was released