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

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

Open mssoliveira opened this issue 2 years ago • 18 comments

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch [email protected] for the project I'm working on.

replace the code to solve my problem in React Native 0.69.6 to import the 'deprecated-react-native-prop-types'

Here is the diff that solved my problem:

diff --git a/node_modules/react-native-snap-carousel/src/carousel/Carousel.js b/node_modules/react-native-snap-carousel/src/carousel/Carousel.js
index dae71a3..8056cd4 100644
--- a/node_modules/react-native-snap-carousel/src/carousel/Carousel.js
+++ b/node_modules/react-native-snap-carousel/src/carousel/Carousel.js
@@ -1,5 +1,6 @@
 import React, { Component } from 'react';
-import { Animated, Easing, FlatList, I18nManager, Platform, ScrollView, View, ViewPropTypes } from 'react-native';
+import { Animated, Easing, FlatList, I18nManager, Platform, ScrollView, View } from 'react-native';
+import { ViewPropTypes } from 'deprecated-react-native-prop-types'
 import PropTypes from 'prop-types';
 import shallowCompare from 'react-addons-shallow-compare';
 import {
diff --git a/node_modules/react-native-snap-carousel/src/pagination/Pagination.js b/node_modules/react-native-snap-carousel/src/pagination/Pagination.js
index 5c021cf..4741489 100644
--- a/node_modules/react-native-snap-carousel/src/pagination/Pagination.js
+++ b/node_modules/react-native-snap-carousel/src/pagination/Pagination.js
@@ -1,5 +1,6 @@
 import React, { PureComponent } from 'react';
-import { I18nManager, Platform, View, ViewPropTypes } from 'react-native';
+import { I18nManager, Platform, View } from 'react-native';
+import { ViewPropTypes } from 'deprecated-react-native-prop-types'
 import PropTypes from 'prop-types';
 import PaginationDot from './PaginationDot';
 import styles from './Pagination.style';
diff --git a/node_modules/react-native-snap-carousel/src/pagination/PaginationDot.js b/node_modules/react-native-snap-carousel/src/pagination/PaginationDot.js
index e59d196..84821b5 100644
--- a/node_modules/react-native-snap-carousel/src/pagination/PaginationDot.js
+++ b/node_modules/react-native-snap-carousel/src/pagination/PaginationDot.js
@@ -1,5 +1,6 @@
 import React, { PureComponent } from 'react';
-import { View, Animated, Easing, TouchableOpacity, ViewPropTypes } from 'react-native';
+import { View, Animated, Easing, TouchableOpacity } from 'react-native';
+import { ViewPropTypes } from 'deprecated-react-native-prop-types'
 import PropTypes from 'prop-types';
 import styles from './Pagination.style';
 
diff --git a/node_modules/react-native-snap-carousel/src/parallaximage/ParallaxImage.js b/node_modules/react-native-snap-carousel/src/parallaximage/ParallaxImage.js
index 8bc774a..8fc99b7 100644
--- a/node_modules/react-native-snap-carousel/src/parallaximage/ParallaxImage.js
+++ b/node_modules/react-native-snap-carousel/src/parallaximage/ParallaxImage.js
@@ -1,7 +1,8 @@
 // Parallax effect inspired by https://github.com/oblador/react-native-parallax/
 
 import React, { Component } from 'react';
-import { View, ViewPropTypes, Image, Animated, Easing, ActivityIndicator, findNodeHandle } from 'react-native';
+import { View, Image, Animated, Easing, ActivityIndicator, findNodeHandle } from 'react-native';
+import { ViewPropTypes } from 'deprecated-react-native-prop-types'
 import PropTypes from 'prop-types';
 import styles from './ParallaxImage.style';
 

This issue body was partially generated by patch-package.

mssoliveira avatar Sep 29 '22 18:09 mssoliveira

is anyone actively working on this repo ? this issue is becoming a real problem with newest versions of react native

minotogna avatar Sep 30 '22 10:09 minotogna

up

alefemafra avatar Sep 30 '22 11:09 alefemafra

Perhaps we'd be better off with someone just forking the project if there's no one around to build a new version anymore?

paulsjohnson91 avatar Oct 01 '22 20:10 paulsjohnson91

Have a fork here and when installing from this it works fine for me

paulsjohnson91 avatar Oct 01 '22 21:10 paulsjohnson91

Have a fork here and when installing from this it works fine for me

Hi @paulsjohnson91 , will you maintain and/or add features ? I also noticed there's this https://github.com/dohooo/react-native-reanimated-carousel#readme that looks promising. 👋

minotogna avatar Oct 02 '22 15:10 minotogna

https://github.com/meliorence/react-native-snap-carousel/pull/955 I sent PR for this error.

lfabl avatar Oct 03 '22 18:10 lfabl

https://github.com/meliorence/react-native-snap-carousel/pull/955 I sent PR for this error.

This package is abandoned

minotogna avatar Oct 04 '22 06:10 minotogna

Well, they can use this: https://github.com/lfabl/react-native-snap-carousel

yarn add https://github.com/lfabl/react-native-snap-carousel
or
npm i --save https://github.com/lfabl/react-native-snap-carousel

lfabl avatar Oct 04 '22 10:10 lfabl

There is working beta for newest version of react native: https://www.npmjs.com/package/react-native-snap-carousel/v/4.0.0-beta.6

npm i [email protected]

michal-pusz avatar Oct 04 '22 13:10 michal-pusz

There is working beta for newest version of react native: https://www.npmjs.com/package/react-native-snap-carousel/v/4.0.0-beta.6

npm i [email protected]

@michal-pusz but why no answer from the maintainer ? it's a bit risky to use this in a production software

minotogna avatar Oct 05 '22 05:10 minotogna

react-native-reanimated-carousel seems to be the way to go as it's actively maintained

paulsjohnson91 avatar Oct 05 '22 08:10 paulsjohnson91

react-native-reanimated-carousel seems to be the way to go as it's actively maintained

looks good

farhanhaider1 avatar Oct 05 '22 20:10 farhanhaider1

There is working beta for newest version of react native: https://www.npmjs.com/package/react-native-snap-carousel/v/4.0.0-beta.6 npm i [email protected]

@michal-pusz but why no answer from the maintainer ? it's a bit risky to use this in a production software

i was thinking the same! why not comment if something exists

i did try it and works fine for me

farhanhaider1 avatar Oct 05 '22 20:10 farhanhaider1

Can anyone confirm that version [email protected] works on RN 0.69+ ?

danidaryaweesh avatar Oct 13 '22 22:10 danidaryaweesh

@danidaryaweesh I tried it and seems to be working fine, but please be careful if you want to use it in production environment since it seems to be a beta version only.

Guille47 avatar Oct 14 '22 03:10 Guille47

Thanks for the feedback @Guille47! I was already using this library in production with no issues. But I'm upgrading my RN from version 0.64.2 to 0.69.6, so I'm checking all libraries before doing that

danidaryaweesh avatar Oct 15 '22 11:10 danidaryaweesh

Guys i already create a fork, because i think something happened with the maintainer of this repo ... try using my solution on

https://www.npmjs.com/package/react-native-new-snap-carousel

hope this help

ciberbob-007 avatar Oct 31 '22 14:10 ciberbob-007

Guys i already create a fork, because i think something happened with the maintainer of this repo ... try using my solution on

https://www.npmjs.com/package/react-native-new-snap-carousel

hope this help

i tried your one but 404 not found error is coming please share solution for that

deepaktractorj avatar Nov 07 '22 06:11 deepaktractorj