react-native-snap-carousel
react-native-snap-carousel copied to clipboard
ViewPropTypes will be removed from React Native. Migrate to ViewPropTypes exported from 'deprecated-react-native-prop-types'.
Is this a bug report, a feature request, or a question?
Bug Report
Have you followed the required steps before opening a bug report?
(Check the step you've followed - put an x character between the square brackets ([]).)
- [X] I have read the guidelines regarding bug report.
- [X] I have reviewed the documentation in its entirety, including the dedicated documentations :books:.
- [X] I have searched for existing issues and made sure that the problem hasn't already been reported.
- [X] I am using the latest plugin version.
- [X] I am following the issue template closely in order to produce a useful bug report.
Have you made sure that it wasn't a React Native bug?
Yes, it's a warning from React Native about something carousel is using that's going away.
Is the bug specific to iOS or Android? Or can it be reproduced on both platforms?
Not platform sepecific.
Is the bug reproductible in a production environment (not a debug one)?
Yes.
Environment
(Write your answer here.)
Expected Behavior
Should migrate to ViewPropTypes exported from 'deprecated-react-native-prop-types' for now or potentially find a longer term solution.
Actual Behavior
Warnings that it will break on future RN release.
Reproducible Demo
Any RN project using 68.1+ or Expo 45+ and carousel will display the warning.
Steps to Reproduce
Any RN project using 68.1+ or Expo 45+ and carousel will display the warning.
+1
+1 open files ./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
edit
import { ... ,ViewPropTypes } from 'react-native';
to
import { ... } from 'react-native';
import {ViewPropTypes} from 'deprecated-react-native-prop-types';
- 05.17 Edit
edit 1 file => 4 files It Working! can't see warning anymore.
RN 68.1+
https://github.com/facebook/react-native/issues/33557
For anyone looking to address the above changes in their repo, just use patch package
+1
+1
+1
to address the above changes in their repo, just u
Will my app build correctly with EXPO if i do this?
+1
+1
this is currently breaking the build
+1
+1
+1
I found the answer for me https://github.com/meliorence/react-native-snap-carousel/issues/928#issuecomment-1179549047 It solves my problem
But I just downloaded this package yarn add [email protected] and that's all
I found the answer for me #928 (comment) It solves my problem
But I just downloaded this package yarn add [email protected] and that's all
Thanks! It Works!
@PavelKabenets Thanks you bro ! It Works
I'm updating my React Native app for version 0.71 and this warning now is a breaking change. I usually avoid to install beta versions on the app. Any thoughts of when this fix will be released on a stable version?
@gui-grana Because of the same issue, I changed all my carousels to use this package instead: react-native-reanimated-carousel. It was quite simple and easy and It didn't need that much change in the codes.
The last update of react-native-snap-carousel is from 3 years ago. So, I don't think there is any effort to update and fix the related issues.
@Garamani I will read the docs and think about changing packages here too. Thanks for the tip.
Wow by the looks of it, it seems like the creator of this library has taken a break or disappeared. So many unaccepted PRs, smh.
+1 open files ./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
edit
import { ... ,ViewPropTypes } from 'react-native';to
import { ... } from 'react-native'; import {ViewPropTypes} from 'deprecated-react-native-prop-types';
- 05.17 Edit
edit 1 file => 4 files It Working! can't see warning anymore.
RN 68.1+
Thanks man, this approach helped me!
The only thing I had to do in addition to your suggestion to make the carousel work was installing the deprecated react native prop types package with yarn add [email protected]
+1 open files ./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
edit
import { ... ,ViewPropTypes } from 'react-native';to
import { ... } from 'react-native'; import {ViewPropTypes} from 'deprecated-react-native-prop-types';
- 05.17 Edit
edit 1 file => 4 files It Working! can't see warning anymore.
RN 68.1+
can anyone explain to me how is this working without the snap-carousel library having the deprecated-prop-types package inside of it ? I've used patch package and it results with "unable to resolve module" error which makes sense, since snap carousel library doesn't have the package.