Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions src/carousel/Carousel.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
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 PropTypes from 'prop-types';
import shallowCompare from 'react-addons-shallow-compare';
import {
Expand Down Expand Up @@ -43,8 +43,8 @@ export default class Carousel extends Component {
autoplayDelay: PropTypes.number,
autoplayInterval: PropTypes.number,
callbackOffsetMargin: PropTypes.number,
containerCustomStyle: ViewPropTypes ? ViewPropTypes.style : View.propTypes.style,
contentContainerCustomStyle: ViewPropTypes ? ViewPropTypes.style : View.propTypes.style,
containerCustomStyle: () => null,
contentContainerCustomStyle: () => null,
enableMomentum: PropTypes.bool,
enableSnap: PropTypes.bool,
firstItem: PropTypes.number,
Expand All @@ -61,7 +61,7 @@ export default class Carousel extends Component {
scrollEnabled: PropTypes.bool,
scrollInterpolator: PropTypes.func,
slideInterpolatedStyle: PropTypes.func,
slideStyle: ViewPropTypes ? ViewPropTypes.style : View.propTypes.style,
slideStyle: () => null,
shouldOptimizeUpdates: PropTypes.bool,
swipeThreshold: PropTypes.number,
useScrollView: PropTypes.oneOfType([PropTypes.bool, PropTypes.func]),
Expand Down Expand Up @@ -151,9 +151,6 @@ export default class Carousel extends Component {
this._ignoreNextMomentum = false;

// Warnings
if (!ViewPropTypes) {
console.warn('react-native-snap-carousel: It is recommended to use at least version 0.44 of React Native with the plugin');
}
if (!props.vertical && (!props.sliderWidth || !props.itemWidth)) {
console.error('react-native-snap-carousel: You need to specify both `sliderWidth` and `itemWidth` for horizontal carousels');
}
Expand Down
10 changes: 5 additions & 5 deletions src/pagination/Pagination.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { PureComponent } from 'react';
import { I18nManager, Platform, View, ViewPropTypes } from 'react-native';
import { I18nManager, Platform, View } from 'react-native';
import PropTypes from 'prop-types';
import PaginationDot from './PaginationDot';
import styles from './Pagination.style';
Expand All @@ -14,16 +14,16 @@ export default class Pagination extends PureComponent {
dotsLength: PropTypes.number.isRequired,
activeOpacity: PropTypes.number,
carouselRef: PropTypes.object,
containerStyle: ViewPropTypes ? ViewPropTypes.style : View.propTypes.style,
containerStyle: () => null,
dotColor: PropTypes.string,
dotContainerStyle: ViewPropTypes ? ViewPropTypes.style : View.propTypes.style,
dotContainerStyle: () => null,
dotElement: PropTypes.element,
dotStyle: ViewPropTypes ? ViewPropTypes.style : View.propTypes.style,
dotStyle: () => null,
inactiveDotColor: PropTypes.string,
inactiveDotElement: PropTypes.element,
inactiveDotOpacity: PropTypes.number,
inactiveDotScale: PropTypes.number,
inactiveDotStyle: ViewPropTypes ? ViewPropTypes.style : View.propTypes.style,
inactiveDotStyle: () => null,
renderDots: PropTypes.func,
tappableDots: PropTypes.bool,
vertical: PropTypes.bool,
Expand Down
8 changes: 4 additions & 4 deletions src/pagination/PaginationDot.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { PureComponent } from 'react';
import { View, Animated, Easing, TouchableOpacity, ViewPropTypes } from 'react-native';
import { View, Animated, Easing, TouchableOpacity } from 'react-native';
import PropTypes from 'prop-types';
import styles from './Pagination.style';

Expand All @@ -12,11 +12,11 @@ export default class PaginationDot extends PureComponent {
activeOpacity: PropTypes.number,
carouselRef: PropTypes.object,
color: PropTypes.string,
containerStyle: ViewPropTypes ? ViewPropTypes.style : View.propTypes.style,
containerStyle: () => null,
inactiveColor: PropTypes.string,
inactiveStyle: ViewPropTypes ? ViewPropTypes.style : View.propTypes.style,
inactiveStyle: () => null,
index: PropTypes.number,
style: ViewPropTypes ? ViewPropTypes.style : View.propTypes.style,
style: () => null,
tappable: PropTypes.bool
};

Expand Down
4 changes: 2 additions & 2 deletions src/parallaximage/ParallaxImage.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// 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 PropTypes from 'prop-types';
import styles from './ParallaxImage.style';

Expand All @@ -16,7 +16,7 @@ export default class ParallaxImage extends Component {
sliderHeight: PropTypes.number, // passed from <Carousel />
sliderWidth: PropTypes.number, // passed from <Carousel />
vertical: PropTypes.bool, // passed from <Carousel />
containerStyle: ViewPropTypes ? ViewPropTypes.style : View.propTypes.style,
containerStyle: () => null,
dimensions: PropTypes.shape({
width: PropTypes.number,
height: PropTypes.number
Expand Down