FAQ

FAQ


Optimizing

When rendering a large number of elements, you can use the 'windowSize' property to control how many items of the current element are rendered. The default is full rendering. After testing without this property, frames will drop when rendering 200 empty views. After setting this property, rendering 1000 empty views is still smooth. (The specific number depends on the phone model tested)

Used in ScrollView/FlatList

#143 (opens in a new tab) - Carousel suppresses ScrollView/FlatList scroll gesture handler: When using a carousel with a layout oriented to only one direction (vertical/horizontal) and inside a ScrollView/FlatList, it is important for the user experience that the unused axis does not impede the scroll of the list. So that, for example, the x-axis is free we can change the activeOffsetX (opens in a new tab) of the gesture handler:

<Carousel
  {...}
  onConfigurePanGesture={gestureChain => (
    gestureChain.activeOffsetX([-10, 10])
  )}
/>

RTL

Support to RTL mode with no more configuration needed. But in RTL mode, need to manually set the autoPlayReverse props for autoplay to control scrolling direction.

EXPO

If use EXPO managed workflow please ensure that the version is greater than 41.Because the old version not support Reanimated(v2).

Working principle

How it works?

How to run tests in example/expo

$ yarn prepare
$ yarn link --global
$ cd ./example/expo
$ yarn link react-native-reanimated-carousel --global
$ yarn test