Introduction
I couldn’t find the fix for this error anywhere in the react-native-snap-carousel
package, and it was really frustrating.
Eventually, I solved it and I hope my quick fix helps other frustrated developers. If you have a better solution, please let me know.
Solution
(1) Install react-style-proptype
(2) Open the following files in the node_modules folder once you’ve installed react-native-snap-carousel
:
node_modules\react-native-snap-carousel\src\carousel\Carousel.js
node_modules\react-native-snap-carousel\src\pagination\Pagination.js
node_modules\react-native-snap-carousel\src\pagination\PaginationDot.js
node_modules\react-native-snap-carousel\src\parallaximage\ParallaxImage.js
(3) Import react-style-proptype
, as prescribed by the documentation, in each file mentioned above.
(4) Replace all instances of ViewPropTypes ? ViewPropTypes.style : View.propTypes.style
with stylePropType
.
(5) Delete the ViewPropTypes
named import from ‘react-native’
Conclusion
Voila! Hopefully, this works for you too. If this helped, then please leave a like or comment. And once again, if you find a better solution, please let me know.
If you liked this article, then please support me
Top comments (3)
THANKSSS MANNN!!!!
This seriously just saved my day! Thank you!
I'm glad I could help 😃