Tags
react.js
Asked 2 years ago
20 Jul 2022
Views 1229
Romaine

Romaine posted

React native - Error : export 'ViewPropTypes' was not found

React native - Error : export 'ViewPropTypes' was not found


node_modules/react-native-snap-carousel/src/carousel/Carousel.js:154:13
"export 'ViewPropTypes' was not found in 'react-native-web/dist/index'
  152 |
  153 |         // Warnings
> 154 |         if (!ViewPropTypes) {
      |             ^
  155 |             console.warn('react-native-snap-carousel: It is recommended
to use at least version 0.44 of React Native with the plugin');
  156 |         }
  157 |         if (!props.vertical && (!props.sliderWidth || !props.itemWidth))
 {
./node_modules/react-native-snap-carousel/src/carousel/Carousel.js:46:30
"export 'ViewPropTypes' was not found in 'react-native-web/dist/index'
  44 |         autoplayInterval: PropTypes.number,
  45 |         callbackOffsetMargin: PropTypes.number,
> 46 |         containerCustomStyle: ViewPropTypes ? ViewPropTypes.style : View.
propTypes.style,
     |                              ^
  47 |         contentContainerCustomStyle: ViewPropTypes ? ViewPropTypes.style
: View.propTypes.style,
  48 |         enableMomentum: PropTypes.bool,
  49 |         enableSnap: PropTypes.bool,
./node_modules/react-native-snap-carousel/src/carousel/Carousel.js:46:46
"export 'ViewPropTypes' was not found in 'react-native-web/dist/index'
  44 |         autoplayInterval: PropTypes.number,
  45 |         callbackOffsetMargin: PropTypes.number,
> 46 |         containerCustomStyle: ViewPropTypes ? ViewPropTypes.style : View.
propTypes.style,
     |                                              ^
  47 |         contentContainerCustomStyle: ViewPropTypes ? ViewPropTypes.style
: View.propTypes.style,
  48 |         enableMomentum: PropTypes.bool,
  49 |         enableSnap: PropTypes.bool,
./node_modules/react-native-snap-carousel/src/carousel/Carousel.js:47:37
"export 'ViewPropTypes' was not found in 'react-native-web/dist/index'
  45 |         callbackOffsetMargin: PropTypes.number,
  46 |         containerCustomStyle: ViewPropTypes ? ViewPropTypes.style : View.
propTypes.style,
> 47 |         contentContainerCustomStyle: ViewPropTypes ? ViewPropTypes.style
: View.propTypes.style,
     |                                     ^
  48 |         enableMomentum: PropTypes.bool,
  49 |         enableSnap: PropTypes.bool,
  50 |         firstItem: PropTypes.number,
./node_modules/react-native-snap-carousel/src/carousel/Carousel.js:47:53
"export 'ViewPropTypes' was not found in 'react-native-web/dist/index'
  45 |         callbackOffsetMargin: PropTypes.number,
  46 |         containerCustomStyle: ViewPropTypes ? ViewPropTypes.style : View.
propTypes.style,
> 47 |         contentContainerCustomStyle: ViewPropTypes ? ViewPropTypes.style
: View.propTypes.style,
     |                                                     ^
  48 |         enableMomentum: PropTypes.bool,
  49 |         enableSnap: PropTypes.bool,
  50 |         firstItem: PropTypes.number,
./node_modules/react-native-snap-carousel/src/carousel/Carousel.js:64:20
"export 'ViewPropTypes' was not found in 'react-native-web/dist/index'
  62 |         scrollInterpolator: PropTypes.func,
  63 |         slideInterpolatedStyle: PropTypes.func,
> 64 |         slideStyle: ViewPropTypes ? ViewPropTypes.style : View.propTypes.
style,
     |                    ^
  65 |         shouldOptimizeUpdates: PropTypes.bool,
  66 |         swipeThreshold: PropTypes.number,
  67 |         useScrollView: PropTypes.oneOfType([PropTypes.bool, PropTypes.fun
c]),
./node_modules/react-native-snap-carousel/src/carousel/Carousel.js:64:36
"export 'ViewPropTypes' was not found in 'react-native-web/dist/index'
  62 |         scrollInterpolator: PropTypes.func,
  63 |         slideInterpolatedStyle: PropTypes.func,
> 64 |         slideStyle: ViewPropTypes ? ViewPropTypes.style : View.propTypes.
style,
     |                                    ^
  65 |         shouldOptimizeUpdates: PropTypes.bool,
  66 |         swipeThreshold: PropTypes.number,
  67 |         useScrollView: PropTypes.oneOfType([PropTypes.bool, PropTypes.fun
c]),
./node_modules/react-native-snap-carousel/src/parallaximage/ParallaxImage.js:19:
24
"export 'ViewPropTypes' was not found in 'react-native-web/dist/index'
  17 |         sliderWidth: PropTypes.number, // passed from <Carousel />
  18 |         vertical: PropTypes.bool, // passed from <Carousel />
> 19 |         containerStyle: ViewPropTypes ? ViewPropTypes.style : View.propTy
pes.style,
     |                        ^
  20 |         dimensions: PropTypes.shape({
  21 |             width: PropTypes.number,
  22 |             height: PropTypes.number
./node_modules/react-native-snap-carousel/src/parallaximage/ParallaxImage.js:19:
40
"export 'ViewPropTypes' was not found in 'react-native-web/dist/index'
  17 |         sliderWidth: PropTypes.number, // passed from <Carousel />
  18 |         vertical: PropTypes.bool, // passed from <Carousel />
> 19 |         containerStyle: ViewPropTypes ? ViewPropTypes.style : View.propTy
pes.style,
     |                                        ^
  20 |         dimensions: PropTypes.shape({
  21 |             width: PropTypes.number,
  22 |             height: PropTypes.number
./node_modules/react-native-snap-carousel/src/pagination/Pagination.js:17:24
"export 'ViewPropTypes' was not found in 'react-native-web/dist/index'
  15 |         activeOpacity: PropTypes.number,
  16 |         carouselRef: PropTypes.object,
> 17 |         containerStyle: ViewPropTypes ? ViewPropTypes.style : View.propTy
pes.style,
     |                        ^
  18 |         dotColor: PropTypes.string,
  19 |         dotContainerStyle: ViewPropTypes ? ViewPropTypes.style : View.pro
pTypes.style,
  20 |         dotElement: PropTypes.element,
./node_modules/react-native-snap-carousel/src/pagination/Pagination.js:17:40
"export 'ViewPropTypes' was not found in 'react-native-web/dist/index'
  15 |         activeOpacity: PropTypes.number,
  16 |         carouselRef: PropTypes.object,
> 17 |         containerStyle: ViewPropTypes ? ViewPropTypes.style : View.propTy
pes.style,
     |                                        ^
  18 |         dotColor: PropTypes.string,
  19 |         dotContainerStyle: ViewPropTypes ? ViewPropTypes.style : View.pro
pTypes.style,
  20 |         dotElement: PropTypes.element,
./node_modules/react-native-snap-carousel/src/pagination/Pagination.js:19:27
"export 'ViewPropTypes' was not found in 'react-native-web/dist/index'
  17 |         containerStyle: ViewPropTypes ? ViewPropTypes.style : View.propTy
pes.style,
  18 |         dotColor: PropTypes.string,
> 19 |         dotContainerStyle: ViewPropTypes ? ViewPropTypes.style : View.pro
pTypes.style,
     |                           ^
  20 |         dotElement: PropTypes.element,
  21 |         dotStyle: ViewPropTypes ? ViewPropTypes.style : View.propTypes.st
yle,
  22 |         inactiveDotColor: PropTypes.string,
./node_modules/react-native-snap-carousel/src/pagination/Pagination.js:19:43
"export 'ViewPropTypes' was not found in 'react-native-web/dist/index'
  17 |         containerStyle: ViewPropTypes ? ViewPropTypes.style : View.propTy
pes.style,
  18 |         dotColor: PropTypes.string,
> 19 |         dotContainerStyle: ViewPropTypes ? ViewPropTypes.style : View.pro
pTypes.style,
     |                                           ^
  20 |         dotElement: PropTypes.element,
  21 |         dotStyle: ViewPropTypes ? ViewPropTypes.style : View.propTypes.st
yle,
  22 |         inactiveDotColor: PropTypes.string,
./node_modules/react-native-snap-carousel/src/pagination/Pagination.js:21:18
"export 'ViewPropTypes' was not found in 'react-native-web/dist/index'
  19 |         dotContainerStyle: ViewPropTypes ? ViewPropTypes.style : View.pro
pTypes.style,
  20 |         dotElement: PropTypes.element,
> 21 |         dotStyle: ViewPropTypes ? ViewPropTypes.style : View.propTypes.st
yle,
     |                  ^
  22 |         inactiveDotColor: PropTypes.string,
  23 |         inactiveDotElement: PropTypes.element,
  24 |         inactiveDotOpacity: PropTypes.number,
./node_modules/react-native-snap-carousel/src/pagination/Pagination.js:21:34
"export 'ViewPropTypes' was not found in 'react-native-web/dist/index'
  19 |         dotContainerStyle: ViewPropTypes ? ViewPropTypes.style : View.pro
pTypes.style,
  20 |         dotElement: PropTypes.element,
> 21 |         dotStyle: ViewPropTypes ? ViewPropTypes.style : View.propTypes.st
yle,
     |                                  ^
  22 |         inactiveDotColor: PropTypes.string,
  23 |         inactiveDotElement: PropTypes.element,
  24 |         inactiveDotOpacity: PropTypes.number,
./node_modules/react-native-snap-carousel/src/pagination/Pagination.js:26:26
"export 'ViewPropTypes' was not found in 'react-native-web/dist/index'
  24 |         inactiveDotOpacity: PropTypes.number,
  25 |         inactiveDotScale: PropTypes.number,
> 26 |         inactiveDotStyle: ViewPropTypes ? ViewPropTypes.style : View.prop
Types.style,
     |                          ^
  27 |         renderDots: PropTypes.func,
  28 |         tappableDots: PropTypes.bool,
  29 |         vertical: PropTypes.bool,
./node_modules/react-native-snap-carousel/src/pagination/Pagination.js:26:42
"export 'ViewPropTypes' was not found in 'react-native-web/dist/index'
  24 |         inactiveDotOpacity: PropTypes.number,
  25 |         inactiveDotScale: PropTypes.number,
> 26 |         inactiveDotStyle: ViewPropTypes ? ViewPropTypes.style : View.prop
Types.style,
     |                                          ^
  27 |         renderDots: PropTypes.func,
  28 |         tappableDots: PropTypes.bool,
  29 |         vertical: PropTypes.bool,
./node_modules/react-native-snap-carousel/src/pagination/PaginationDot.js:15:24
"export 'ViewPropTypes' was not found in 'react-native-web/dist/index'
  13 |         carouselRef: PropTypes.object,
  14 |         color: PropTypes.string,
> 15 |         containerStyle: ViewPropTypes ? ViewPropTypes.style : View.propTy
pes.style,
     |                        ^
  16 |         inactiveColor: PropTypes.string,
  17 |         inactiveStyle: ViewPropTypes ? ViewPropTypes.style : View.propTyp
es.style,
  18 |         index: PropTypes.number,
./node_modules/react-native-snap-carousel/src/pagination/PaginationDot.js:15:40
"export 'ViewPropTypes' was not found in 'react-native-web/dist/index'
  13 |         carouselRef: PropTypes.object,
  14 |         color: PropTypes.string,
> 15 |         containerStyle: ViewPropTypes ? ViewPropTypes.style : View.propTy
pes.style,
     |                                        ^
  16 |         inactiveColor: PropTypes.string,
  17 |         inactiveStyle: ViewPropTypes ? ViewPropTypes.style : View.propTyp
es.style,
  18 |         index: PropTypes.number,
./node_modules/react-native-snap-carousel/src/pagination/PaginationDot.js:17:23
"export 'ViewPropTypes' was not found in 'react-native-web/dist/index'
  15 |         containerStyle: ViewPropTypes ? ViewPropTypes.style : View.propTy
pes.style,
  16 |         inactiveColor: PropTypes.string,
> 17 |         inactiveStyle: ViewPropTypes ? ViewPropTypes.style : View.propTyp
es.style,
     |                       ^
  18 |         index: PropTypes.number,
  19 |         style: ViewPropTypes ? ViewPropTypes.style : View.propTypes.style
,
  20 |         tappable: PropTypes.bool
./node_modules/react-native-snap-carousel/src/pagination/PaginationDot.js:17:39
"export 'ViewPropTypes' was not found in 'react-native-web/dist/index'
  15 |         containerStyle: ViewPropTypes ? ViewPropTypes.style : View.propTy
pes.style,
  16 |         inactiveColor: PropTypes.string,
> 17 |         inactiveStyle: ViewPropTypes ? ViewPropTypes.style : View.propTyp
es.style,
     |                                       ^
  18 |         index: PropTypes.number,
  19 |         style: ViewPropTypes ? ViewPropTypes.style : View.propTypes.style
,
  20 |         tappable: PropTypes.bool
./node_modules/react-native-snap-carousel/src/pagination/PaginationDot.js:19:15
"export 'ViewPropTypes' was not found in 'react-native-web/dist/index'
  17 |         inactiveStyle: ViewPropTypes ? ViewPropTypes.style : View.propTyp
es.style,
  18 |         index: PropTypes.number,
> 19 |         style: ViewPropTypes ? ViewPropTypes.style : View.propTypes.style
,
     |               ^
  20 |         tappable: PropTypes.bool
  21 |     };
  22 |
./node_modules/react-native-snap-carousel/src/pagination/PaginationDot.js:19:31
"export 'ViewPropTypes' was not found in 'react-native-web/dist/index'
  17 |         inactiveStyle: ViewPropTypes ? ViewPropTypes.style : View.propTyp
es.style,
  18 |         index: PropTypes.number,
> 19 |         style: ViewPropTypes ? ViewPropTypes.style : View.propTypes.style
,
     |                               ^
  20 |         tappable: PropTypes.bool
  21 |     };
denyy

denyy
answered Nov 30 '-1 00:00

try to re-install module react-native-snap-carousel again , may be it works



npm i react-native-snap-carousel


jagdish

jagdish
answered Feb 25 '23 00:00

The error "export 'ViewPropTypes' was not found" usually occurs when trying to use the ViewPropTypes component in a React Native application.

To resolve this issue, you can try the following steps:

Make sure you have the latest version of React Native installed.

Import the ViewPropTypes component from the 'react-native' package instead of 'react':



import { ViewPropTypes } from 'react-native';

Check that you are using the correct version of the 'react-native' package . If you are using a version earlier than 0.44, ViewPropTypes may not be available.

If you are using a third-party library that depends on ViewPropTypes, make sure that it is compatible with your version of React Native.

If none of the above solutions work, try deleting the 'node_modules' folder in your project directory and reinstalling all dependencies using 'npm install' or 'yarn install'.

Post Answer