Error:
deprecated-react-native-prop-types
"react-native": "0.69.1",—- this error comes only in the latest version of react-native
I am facing this issues when I installed any of this library
-react-native-snap-carousel
-react-native-fast-image
Requiring module
"node_modules/react-native-snap-carousel/src/index.js", which threw an
exception: Invariant Violation: ViewPropTypes has been removed from
React Native. Migrate to ViewPropTypes exported from
‘deprecated-react-native-prop-types’.
3
Answers
This is a mistake of the old npm packages, and if the project is alive, then the developers fix it in new versions. And maybe this error will go away when you update the package to a newer one.
I PREFER TO FOLLOW THE FIRST APPROACH
find ViewPropTypes import in the node modules in which library this gives error delete import this file from 'react-native' and create new import
and its also work good but when you install new package or npm install again you have to do this steps againn for the libraries which gives same error
here is the answer
install this package deprecated-react-native-prop-types and if u install a new package search for this replace the below modules. these are the changes for
node_modules/react-native/index.js
open files
edit
to
it will work…