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

ERROR ViewPropTypes will be removed from React Native, along with all other PropTypes. We recommend that you migrate away from PropTypes and switch to a type system like TypeScript.

Open GrimonprezAlexis opened this issue 1 year ago • 17 comments

[Expo App] - React native IOS

ERROR ViewPropTypes will be removed from React Native, along with all other PropTypes. We recommend that you migrate away from PropTypes and switch to a type system like TypeScript.

If you need to continue using ViewPropTypes, migrate to the deprecated-react-native-prop-types package. This package provides the old PropTypes that have been removed from React Native.

  1. npm install deprecated-react-native-prop-types

  2. Import the ViewPropTypes from deprecated-react-native-prop-types instead of react-native

import { ViewPropTypes } from 'deprecated-react-native-prop-types';

  1. Replace all instances of ViewPropTypes in theses files

Carousel.js, Pagination.js, PaginationDot.js, ParallaxImage.js

GrimonprezAlexis avatar Mar 28 '23 00:03 GrimonprezAlexis

Same here =/

marcelino-borges avatar Apr 01 '23 12:04 marcelino-borges

I am getting this error as well.

merissaacosta avatar Apr 05 '23 22:04 merissaacosta

Me too

sthota-fms avatar Apr 10 '23 05:04 sthota-fms

me too

offerinn avatar Apr 11 '23 18:04 offerinn

use patch-package react-native-snap-carousel+3.9.1.patch:

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..126a83e 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,7 @@
 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..061f225 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,7 @@
 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..2492c6f 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,7 @@
 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..2466afb 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,9 @@
 // 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';
 

arthurgeron-work avatar Apr 13 '23 19:04 arthurgeron-work

Same here. react-native 0.71.4

I really expect react-native-snap-carousel to upgrade ASAP so it will not break on a newer version of react-native.

feng-yu-healthbank avatar Apr 14 '23 04:04 feng-yu-healthbank

Same here. react-native 0.71.4

I really expect react-native-snap-carousel to upgrade ASAP so it will not break on a newer version of react-native.

This lib is abandoned and will receive no future updates.

arthurgeron-work avatar Apr 14 '23 14:04 arthurgeron-work

Same here. react-native 0.71.4 I really expect react-native-snap-carousel to upgrade ASAP so it will not break on a newer version of react-native.

This lib is abandoned and will receive no future updates.

Has it been replaced by a new library?

feng-yu-healthbank avatar Apr 14 '23 14:04 feng-yu-healthbank

Has it been replaced by a new library?

You might want to migrate to reanimated carousel, though it's not 1:1 with this lib, being more modular which makes it not as simple to set up; But it's actively maintained and less prone to bugs.

Edit: lib link

arthurgeron-work avatar Apr 14 '23 14:04 arthurgeron-work

thank you

feng-yu-healthbank avatar Apr 14 '23 14:04 feng-yu-healthbank

Worked, thanks

delgadostech avatar Apr 16 '23 16:04 delgadostech

Is there is any solution instead of migrating to TypeScript or using other library instead of react-native-snap-carousel

naqeebrajput avatar Jul 19 '23 09:07 naqeebrajput

install this version yarn add [email protected]

Karroch-a avatar Oct 30 '23 14:10 Karroch-a

thank @Karroch-a . Is working.

tuananhse avatar Jan 02 '24 02:01 tuananhse

install this version yarn add [email protected]

Worked for me, thanks.

mathisdev7 avatar Jan 23 '24 03:01 mathisdev7

Thank you @Karroch-a , beta is working.

mirco123 avatar Feb 18 '24 16:02 mirco123

Working on Expo 51, thanks @Karroch-a

dhgomezg6 avatar Jul 03 '24 04:07 dhgomezg6