File tree 1 file changed +6
-2
lines changed
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -60,6 +60,10 @@ export default class Carousel extends BaseComponent {
60
60
* callback for onScroll event of the internal ScrollView
61
61
*/
62
62
onScroll : PropTypes . func ,
63
+ /**
64
+ * Should the container be animated (send the animation style via containerStyle)
65
+ */
66
+ animated : PropTypes . bool ,
63
67
/**
64
68
* the carousel style
65
69
*/
@@ -441,14 +445,14 @@ export default class Carousel extends BaseComponent {
441
445
}
442
446
443
447
renderCarousel ( ) {
444
- const { containerStyle, ...others } = this . getThemeProps ( ) ;
448
+ const { containerStyle, animated , ...others } = this . getThemeProps ( ) ;
445
449
const { initialOffset} = this . state ;
446
450
const scrollContainerStyle = this . shouldUsePageWidth ( ) ? { paddingRight : this . getItemSpacings ( this . getThemeProps ( ) ) } : undefined ;
447
451
const snapToOffsets = this . getSnapToOffsets ( ) ;
448
452
const marginBottom = Math . max ( 0 , this . getContainerPaddingVertical ( ) - 16 ) ;
449
453
450
454
return (
451
- < View style = { [ { marginBottom} , containerStyle ] } onLayout = { this . onContainerLayout } >
455
+ < View animated = { animated } style = { [ { marginBottom} , containerStyle ] } onLayout = { this . onContainerLayout } >
452
456
< ScrollView
453
457
{ ...others }
454
458
ref = { this . carousel }
You can’t perform that action at this time.
0 commit comments