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.24k stars 2.26k forks source link

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. #980

Open GrimonprezAlexis opened 1 year ago

GrimonprezAlexis commented 1 year ago

[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';

  3. Replace all instances of ViewPropTypes in theses files

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

marcelino-borges commented 1 year ago

Same here =/

merissaacosta commented 1 year ago

I am getting this error as well.

sthota-fms commented 1 year ago

Me too

offerinn commented 1 year ago

me too

arthurgeron-work commented 1 year ago

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';
feng-yu-healthbank commented 1 year ago

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.

arthurgeron-work commented 1 year ago

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.

feng-yu-healthbank commented 1 year ago

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?

arthurgeron-work commented 1 year ago

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

feng-yu-healthbank commented 1 year ago

thank you

delgadostech commented 1 year ago

Worked, thanks

naqeebrajput commented 11 months ago

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

Karroch-a commented 8 months ago

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

tuananhse commented 6 months ago

thank @Karroch-a . Is working.

mathisdev7 commented 5 months ago

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

Worked for me, thanks.

mirco123 commented 4 months ago

Thank you @Karroch-a , beta is working.