meliorence / react-native-snap-carousel

Swiper/carousel component for React Native featuring previews, multiple layouts, parallax images, performant handling of huge numbers of items, and more. Compatible with Android & iOS.
BSD 3-Clause "New" or "Revised" License
10.37k stars 2.29k forks source link

ViewPropTypes will be removed from React Native. Migrate to ViewPropTypes exported from 'deprecated-react-native-prop-types'. #923

Open Codelica opened 2 years ago

Codelica commented 2 years ago

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 ([]).)

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.

kbqdev commented 2 years ago

+1

RyuWoong commented 2 years ago

+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'; 
  1. 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

gp3gp3gp3 commented 2 years ago

For anyone looking to address the above changes in their repo, just use patch package

bordernone commented 2 years ago

+1

lucianobracco-geojam commented 2 years ago

+1

kkartunov commented 2 years ago

+1

Morbe17 commented 2 years ago

to address the above changes in their repo, just u

Will my app build correctly with EXPO if i do this?

amirmeimari commented 2 years ago

+1

leoggonzalez commented 2 years ago

+1

this is currently breaking the build

MaymoonaAlBoloshi commented 2 years ago

+1

ihorkolucky commented 2 years ago

+1

PavelKabenets commented 2 years ago

+1

PavelKabenets commented 2 years ago

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 react-native-snap-carousel@4.0.0-beta.6 and that's all

esegebart commented 2 years ago

@PavelKabenets

yarn add react-native-snap-carousel@4.0.0-beta.6

Thank you! This solved my problem too.

SmaelNicolas commented 2 years ago

I found the answer for me #928 (comment) It solves my problem

But I just downloaded this package yarn add react-native-snap-carousel@4.0.0-beta.6 and that's all

Thanks! It Works!

faerylay commented 2 years ago

@PavelKabenets Thanks you bro ! It Works

gui-grana commented 1 year ago

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?

Garamani commented 1 year ago

@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.

gui-grana commented 1 year ago

@Garamani I will read the docs and think about changing packages here too. Thanks for the tip.

localghost1234 commented 1 year ago

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.

fvalles commented 1 year ago

+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'; 
  1. 05.17 Edit

edit 1 file => 4 files It Working! can't see warning anymore.

RN 68.1+

facebook/react-native#33557

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 deprecated-react-native-prop-types@2.2.0

absolutezero13 commented 1 year ago

+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'; 
  1. 05.17 Edit

edit 1 file => 4 files It Working! can't see warning anymore.

RN 68.1+

facebook/react-native#33557

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.