react-native-snap-carousel icon indicating copy to clipboard operation
react-native-snap-carousel copied to clipboard

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

Open Codelica opened this issue 3 years ago • 22 comments

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.

Codelica avatar May 06 '22 15:05 Codelica

+1

kbqdev avatar May 10 '22 02:05 kbqdev

+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

RyuWoong avatar May 11 '22 07:05 RyuWoong

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

gp3gp3gp3 avatar May 18 '22 19:05 gp3gp3gp3

+1

bishnudev01 avatar Jun 24 '22 17:06 bishnudev01

+1

lucianobracco-geojam avatar Jun 29 '22 12:06 lucianobracco-geojam

+1

kkartunov avatar Jul 29 '22 15:07 kkartunov

to address the above changes in their repo, just u

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

Morbe17 avatar Aug 05 '22 00:08 Morbe17

+1

amirmeimari avatar Aug 09 '22 15:08 amirmeimari

+1

this is currently breaking the build

leoggonzalez avatar Aug 26 '22 15:08 leoggonzalez

+1

MaymoonaAlBoloshi avatar Aug 28 '22 10:08 MaymoonaAlBoloshi

+1

ihorkolucky avatar Aug 29 '22 11:08 ihorkolucky

+1

PavelKabenets avatar Sep 06 '22 15:09 PavelKabenets

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

PavelKabenets avatar Sep 06 '22 15:09 PavelKabenets

@PavelKabenets

yarn add [email protected]

Thank you! This solved my problem too.

esegebart avatar Sep 14 '22 16:09 esegebart

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!

SmaelNicolas avatar Oct 04 '22 18:10 SmaelNicolas

@PavelKabenets Thanks you bro ! It Works

faerylay avatar Oct 13 '22 08:10 faerylay

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 avatar Mar 31 '23 14:03 gui-grana

@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 avatar Apr 01 '23 14:04 Garamani

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

gui-grana avatar Apr 03 '23 19:04 gui-grana

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.

localghost1234 avatar May 19 '23 23:05 localghost1234

+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 [email protected]

fvalles avatar Jun 02 '23 18:06 fvalles

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

absolutezero13 avatar Oct 10 '23 18:10 absolutezero13