react-native-reanimated-carousel 2.3.2 → 2.3.3-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -119,6 +119,19 @@ import Carousel from 'react-native-reanimated-carousel';
119
119
  - Optimizing
120
120
 
121
121
  - 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)
122
+
123
+ - Used in `ScrollView/FlastList`
124
+
125
+ - **[#143](https://github.com/dohooo/react-native-reanimated-carousel/issues/143) - Carousel suppresses ScrollView/FlastList 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](https://docs.swmansion.com/react-native-gesture-handler/docs/1.10.3/api/gesture-handlers/pan-gh/#activeoffsetx) of the gesture handler:
126
+
127
+ ```tsx
128
+ <Carousel
129
+ {...}
130
+ panGestureHandlerProps={{
131
+ activeOffsetX: [-10, 10],
132
+ }}
133
+ />
134
+ ```
122
135
 
123
136
  - RTL
124
137
  - 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.
package/README.zh-CN.md CHANGED
@@ -120,6 +120,18 @@ import Carousel from 'react-native-reanimated-carousel';
120
120
 
121
121
  - 优化
122
122
  - 当渲染大量元素时,可使用`windowSize`属性,来控制当前元素的两侧渲染数量,默认为全量渲染。经测试不加此属性,渲染 200 个空 view 时会出现掉帧情况,设置此属性后渲染 1000 个空 view 依旧流畅。(具体数量与测试的手机型号相关)
123
+ - 在`ScrollView/FlastList`中使用
124
+ - **[#143](https://github.com/dohooo/react-native-reanimated-carousel/issues/143) - Carousel suppresses ScrollView/FlastList scroll gesture handler:** 当轮播图被放置在ScrollView/FlatList中时,轮播图的部分将无法控制列表滚动,解决办法是我们只允许手势系统识别某一方向,而不是所有方向,在下方例子中我们为了让列表可以向下滑动,所以我们使用[activeOffsetX](https://docs.swmansion.com/react-native-gesture-handler/docs/1.10.3/api/gesture-handlers/pan-gh/#activeoffsetx)属性来控制轮播图只识别横向手势:
125
+
126
+ ```tsx
127
+ <Carousel
128
+ {...}
129
+ panGestureHandlerProps={{
130
+ activeOffsetX: [-10, 10],
131
+ }}
132
+ />
133
+ ```
134
+
123
135
  - RTL
124
136
  - 所有 layout 均完美支持 RTL 模式,并且无需再做任何配置。但在 RTL 模式下使用自动播放时,默认不会自动转换方向,需要结合 autoPlayReverse 来手动控制方向。
125
137
  - EXPO
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-reanimated-carousel",
3
- "version": "2.3.2",
3
+ "version": "2.3.3-beta.0",
4
4
  "description": "Simple carousel component.fully implemented using Reanimated 2.Infinitely scrolling, very smooth.",
5
5
  "main": "lib/commonjs/index",
6
6
  "types": "lib/typescript/index.d.ts",