Skip to content

Commit 69ca894

Browse files
committed
2 parents ec6adc3 + b50dd0b commit 69ca894

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/components/carousel/index.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ export default class Carousel extends BaseComponent {
6060
* callback for onScroll event of the internal ScrollView
6161
*/
6262
onScroll: PropTypes.func,
63+
/**
64+
* Should the container be animated (send the animation style via containerStyle)
65+
*/
66+
animated: PropTypes.bool,
6367
/**
6468
* the carousel style
6569
*/
@@ -441,14 +445,14 @@ export default class Carousel extends BaseComponent {
441445
}
442446

443447
renderCarousel() {
444-
const {containerStyle, ...others} = this.getThemeProps();
448+
const {containerStyle, animated, ...others} = this.getThemeProps();
445449
const {initialOffset} = this.state;
446450
const scrollContainerStyle = this.shouldUsePageWidth() ? {paddingRight: this.getItemSpacings(this.getThemeProps())} : undefined;
447451
const snapToOffsets = this.getSnapToOffsets();
448452
const marginBottom = Math.max(0, this.getContainerPaddingVertical() - 16);
449453

450454
return (
451-
<View style={[{marginBottom}, containerStyle]} onLayout={this.onContainerLayout}>
455+
<View animated={animated} style={[{marginBottom}, containerStyle]} onLayout={this.onContainerLayout}>
452456
<ScrollView
453457
{...others}
454458
ref={this.carousel}

0 commit comments

Comments
 (0)