Skip to content

Commit c1e01ac

Browse files
authored
Dev/remove extra scroll render (#167)
* remove useOnChangeIndex * Add suport for RTL * bump version * remove warnings
1 parent 322c1db commit c1e01ac

File tree

12 files changed

+39
-29
lines changed

12 files changed

+39
-29
lines changed

.eslintrc.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,7 @@ module.exports = {
1010
describe: false,
1111
expect: false,
1212
},
13+
rules: {
14+
'react-native/no-inline-styles': OFF,
15+
},
1316
};

example/.detoxrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ module.exports = {
5050
emulator: {
5151
type: 'android.emulator',
5252
device: {
53-
avdName: 'Pixel_3a_API_30_x86',
53+
avdName: 'Pixel_4_API_33_arm64',
5454
},
5555
},
5656
},

example/.yarn/cache/react-native-swiper-flatlist-npm-3.2.0-ffef5cca49-e0ed40e123.zip renamed to example/.yarn/cache/react-native-swiper-flatlist-npm-3.2.1-05ffab775e-db9ecb78c1.zip

21.4 KB
Binary file not shown.

example/.yarn/install-state.gz

165 Bytes
Binary file not shown.

example/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"expo-status-bar": "~1.4.4",
2626
"react": "18.2.0",
2727
"react-native": "0.71.6",
28-
"react-native-swiper-flatlist": "3.2.0"
28+
"react-native-swiper-flatlist": "3.2.1"
2929
},
3030
"devDependencies": {
3131
"@babel/core": "^7.20.0",

example/src/App.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ import { StyleSheet, View, SafeAreaView } from 'react-native';
44
import SwiperWithRenderItems from './SwiperWithRenderItems';
55
import SwiperWithChildren from './SwiperWithChildren';
66

7+
// TODO: we should add RTL tests
8+
// I18nManager.forceRTL(true);
9+
// I18nManager.allowRTL(true);
10+
711
export default () => {
812
return (
913
<SafeAreaView style={styles.container}>

example/src/SwiperWithChildren.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export default () => {
2828
showPagination
2929
ref={scrollRef}
3030
onChangeIndex={({ index, prevIndex }) => {
31-
console.log({ index, prevIndex });
31+
console.log('example', { index, prevIndex });
3232
}}
3333
// TODO: rename it to children eg: "container_swiper_children"
3434
e2eID="container_swiper"

example/src/SwiperWithRenderItems.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ const items = Array.from(Array(5)).map((_, index) => image(index));
1414
export default () => {
1515
return (
1616
<SwiperFlatList
17+
// inverted
1718
autoplay
1819
autoplayDelay={2}
1920
// index={3}
@@ -29,6 +30,9 @@ export default () => {
2930
<Text style={styles.text}>Item at index {index}</Text>
3031
</ImageBackground>
3132
)}
33+
// onChangeIndex={({ index, prevIndex }) => {
34+
// console.log('renderItem', { index, prevIndex });
35+
// }}
3236
showPagination
3337
PaginationComponent={CustomPagination}
3438
e2eID="container_swiper_renderItem"

example/yarn.lock

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2819,7 +2819,7 @@ __metadata:
28192819
node-watch: 0.6.2
28202820
react: 18.2.0
28212821
react-native: 0.71.6
2822-
react-native-swiper-flatlist: 3.2.0
2822+
react-native-swiper-flatlist: 3.2.1
28232823
rimraf: ^2.5.4
28242824
languageName: unknown
28252825
linkType: soft
@@ -9108,12 +9108,12 @@ __metadata:
91089108
languageName: node
91099109
linkType: hard
91109110

9111-
"react-native-swiper-flatlist@npm:3.2.0":
9112-
version: 3.2.0
9113-
resolution: "react-native-swiper-flatlist@npm:3.2.0"
9111+
"react-native-swiper-flatlist@npm:3.2.1":
9112+
version: 3.2.1
9113+
resolution: "react-native-swiper-flatlist@npm:3.2.1"
91149114
peerDependencies:
91159115
react-native: ">=0.59.0"
9116-
checksum: e0ed40e123547a214c0c1a67caa6d566dc9e940811f0a9dc445fd13f6cee427a20845e3604b373723cf9f906898885abcde6a53ec8560567a661cc0fc114589f
9116+
checksum: db9ecb78c19d75b8fda110d65329ada4d82e6c2a0a035d47ee612ca5afbd14a9ecd8cce6b6ee7abb71d27e2331db1633bc0a1d08cb90a7377ab684fff0441fa5
91179117
languageName: node
91189118
linkType: hard
91199119

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-swiper-flatlist",
3-
"version": "3.2.1",
3+
"version": "3.2.2",
44
"main": "index.ts",
55
"license": "Apache-2.0",
66
"description": "React native swiper flatlist component",

0 commit comments

Comments
 (0)