Skip to content

Commit 1b5c0bc

Browse files
committed
docs: update README.md file
1 parent 90b2d5e commit 1b5c0bc

File tree

2 files changed

+22
-49
lines changed

2 files changed

+22
-49
lines changed

README.md

Lines changed: 10 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,15 @@ English | [简体中文](./README.zh-CN.md)
1616

1717
<br/>
1818

19-
## Here comes the official edition!
19+
## ReactNative community's best use of the carousel component! 🎉🎉🎉
2020

21-
`v1` has been born, now the carousel will be more natural, and fixed various bugs in the 0.x version, this library will continue to maintain, rest assured to use! [come and experience](https://snack.expo.dev/@zhaodonghao586/simple-carousel) 🎉🎉🎉
22-
23-
Updates:
24-
25-
- Reconstructed some logic, sliding animation more smooth, natural
26-
- timingConfig -> springConfig (The configuration of the 'duration' property is no longer supported by this configuration)
27-
- [...](https://github.com/dohooo/react-native-reanimated-carousel/releases/tag/v1.0.0)
21+
- It completely solves this [problem](https://github.com/meliorence/react-native-snap-carousel/issues/632) for `react-native-snap-carousel`! More styles and apis in development...
22+
- **Simple****Infinitely scrolling very smooth****Fully implemented using Reanimated 2!**
2823

2924
## Reason
3025

31-
🎉 **It completely solves [this problem](https://github.com/meliorence/react-native-snap-carousel/issues/632) for `react-native-snap-carousel`! Simple、Infinitely scrolling very smooth、Fully implemented using Reanimated 2!**
32-
33-
> The common RN infinite scroll component. It's common to get stuck on a fast slide. Wait for the next element to appear. This component will not have similar problems. That's why this library was created.
26+
The common RN infinite scroll component. It's common to get stuck on a fast slide. Wait for the next element to appear. This component will not have similar problems. That's why this library was created.[Try it with SNACK](https://snack.expo.dev/@zhaodonghao586/simple-carousel)
3427

35-
> At present, it only meets the needs of my work. Welcome to raise PR/ISSUES.[Try it with snack](https://snack.expo.dev/@zhaodonghao586/simple-carousel)
3628

3729
<p align="center">
3830
Use react-native-snap-carousel for quick swiping,you can see caton clearly when you reach the junction.(gif 4.6mb)
@@ -72,28 +64,21 @@ If use EXPO managed workflow please ensure that the version is greater than 41.B
7264

7365
## Usage
7466

75-
```typescript
67+
```tsx
7668
import Carousel from 'react-native-reanimated-carousel';
7769

78-
// ...
79-
8070
<Carousel<{ color: string }>
81-
width={width}
71+
width={ width }
8272
data={[{ color: 'red' }, { color: 'purple' }, { color: 'yellow' }]}
8373
renderItem={({ color }) => {
84-
return (
85-
<View
86-
style={{
87-
backgroundColor: color,
88-
justifyContent: 'center',
89-
flex: 1,
90-
}}
91-
/>
92-
);
74+
return <View style={{ backgroundColor: color, flex: 1}}/>
9375
}}
9476
/>;
9577
```
9678

79+
## Optimize
80+
- When rendering a large number of elements, you can use the 'windowSize' property to control how many sides 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)
81+
9782
## Props
9883

9984
| name | required | default | types | description |

README.zh-CN.md

Lines changed: 12 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,17 @@
1616

1717
<br/>
1818

19-
## 正式版来了!
19+
## ReactNative社区最好用的轮播图组件! 🎉🎉🎉
2020

21-
`v1`已经诞生,现在轮播图的滚动将会更加自然,并且修复了 0.x 版本中出现的各种 bug,此库将会持续维护,放心使用! [快来体验](https://snack.expo.dev/@zhaodonghao586/simple-carousel) 🎉🎉🎉
21+
- 完全解决了`react-native-snap-carousel`[问题](https://github.com/meliorence/react-native-snap-carousel/issues/632)! 更多样式与API正在开发中...
22+
- **易用****无限滚动****完全使用 Reanimated2 实现**
2223

23-
更新:
2424

25-
- 重构了部分逻辑,滑动动画更加流畅、自然
26-
- timingConfig -> springConfig (此配置不再支持对`duration`属性的配置)
27-
- [...](https://github.com/dohooo/react-native-reanimated-carousel/releases/tag/v1.0.0)
2825

26+
2927
## 原因
28+
常见的无限滚动轮播图,在快速滑动时会出现卡住的情况,这是因为实现方式而导致的问题。这个组件用了不同的方式来实现,解决了这个问题,这就是创建这个库的原因。[在 SNACK 上尝试](https://snack.expo.dev/@zhaodonghao586/simple-carousel)
3029

31-
🎉 **完全解决了`react-native-snap-carousel`[这个问题](https://github.com/meliorence/react-native-snap-carousel/issues/632)! 易用、无限滚动、完全使用 Reanimated2 实现**
32-
33-
> 常见的无限滚动轮播图,在快速滑动时会出现卡住的情况,这是因为实现方式而导致的问题。这个组件用了不同的方式来实现,解决了这个问题,这就是创建这个库的原因。
34-
35-
> 目前他只满足了我工作上的需要,欢迎大家的 ISSUES/PR。[在 SNACK 上尝试](https://snack.expo.dev/@zhaodonghao586/simple-carousel)
3630

3731
<p align="center">
3832
使用react-native-snap-carousel快速滑动,当到连接处时可以看清楚的看到卡顿。(gif 4.6mb)
@@ -72,28 +66,22 @@ npm install react-native-reanimated-carousel
7266

7367
## 使用
7468

75-
```typescript
69+
```tsx
7670
import Carousel from 'react-native-reanimated-carousel';
7771

78-
// ...
79-
8072
<Carousel<{ color: string }>
81-
width={width}
73+
width={ width }
8274
data={[{ color: 'red' }, { color: 'purple' }, { color: 'yellow' }]}
8375
renderItem={({ color }) => {
84-
return (
85-
<View
86-
style={{
87-
backgroundColor: color,
88-
justifyContent: 'center',
89-
flex: 1,
90-
}}
91-
/>
92-
);
76+
return <View style={{ backgroundColor: color, flex: 1}}/>
9377
}}
9478
/>;
9579
```
9680

81+
## 优化
82+
- 当渲染大量元素时,可使用`windowSize`属性,来控制当前元素的两侧渲染数量,默认为全量渲染。经测试不加此属性,渲染200个空view时会出现掉帧情况,设置此属性后渲染1000个空view依旧流畅。(具体数量与测试的手机型号相关)
83+
84+
9785
## Props
9886

9987
| name | required | default | types | description |

0 commit comments

Comments
 (0)