Gathering detailed insights and metrics for @ohmi/react-native-swipe-list-view
Gathering detailed insights and metrics for @ohmi/react-native-swipe-list-view
Gathering detailed insights and metrics for @ohmi/react-native-swipe-list-view
Gathering detailed insights and metrics for @ohmi/react-native-swipe-list-view
npm install @ohmi/react-native-swipe-list-view
Typescript
Module System
Node Version
NPM Version
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
Latest Version
3.2.9-rc.0.0.4
Package Id
@ohmi/react-native-swipe-list-view@3.2.9-rc.0.0.4
Unpacked Size
137.49 kB
Size
46.89 kB
File Count
22
NPM Version
10.8.2
Node Version
18.20.5
Published on
Jun 19, 2025
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
该项目基于react-native-swipe-list-view开发。
<SwipeListView>
is a vertical ListView with rows that swipe open and closed. Handles default native behavior such as closing rows when ListView is scrolled or when other rows are opened.
Also includes <SwipeRow>
if you want to use a swipeable row outside of the <SwipeListView>
🔥🔥 BREAKING CHANGES 🔥🔥
For use with RN 0.60+ please use react-native-swipe-list-view@2.0.0+
RN 0.60 and RNSLV 2.0.0 deprecate the use of ListView entirely, please see example.js
for examples and see the migrating-to-flatlist doc for a migration guide if you aren't already using FlatList
.
The useFlatList
prop is no longer required, as FlatList
is the default ListView used.
Try it out! https://snack.expo.io/@jemise111/react-native-swipe-list-view
1npm install --save @ohmi/react-native-swipe-list-view
The application under ./SwipeListExample will produce the above example. To run execute the following:
git clone https://gitee.com/kunyuan-hongke/react-native-swipe-list-view
cd react-native-swipe-list-view
cd SwipeListExample
yarn
cd ios
pod install
cd ..
react-native run-ios | react-native run-android
Android: If you get the following error
SwipeListExample/android/app/debug.keystore' not found for signing config 'debug'.
:1cd android/app/ && keytool -genkey -v -keystore debug.keystore -storepass android -alias androiddebugkey -keypass android -keyalg RSA -keysize 2048 -validity 10000 2// answer the questions 3cd ../..
1import { SwipeListView } from 'react-native-swipe-list-view'; 2 3//... note: your data array objects MUST contain a key property 4// or you must pass a keyExtractor to the SwipeListView to ensure proper functionality 5// see: https://reactnative.dev/docs/flatlist#keyextractor 6 7 this.state.listViewData = Array(20) 8 .fill("") 9 .map((_, i) => ({ key: `${i}`, text: `item #${i}` })); 10 11//... 12render() { 13 return ( 14 <SwipeListView 15 data={this.state.listViewData} 16 renderItem={ (data, rowMap) => ( 17 <View style={styles.rowFront}> 18 <Text>I am {data.item.text} in a SwipeListView</Text> 19 </View> 20 )} 21 renderHiddenItem={ (data, rowMap) => ( 22 <View style={styles.rowBack}> 23 <Text>Left</Text> 24 <Text>Right</Text> 25 </View> 26 )} 27 leftOpenValue={75} 28 rightOpenValue={-75} 29 /> 30 ) 31}
See example.js
for full usage guide (including using <SwipeRow>
by itself)
If your row is touchable (TouchableOpacity, TouchableHighlight, etc.) with an onPress
function make sure renderItem
returns the Touchable as the topmost element.
GOOD:
1renderItem={ data => ( 2 <TouchableHighlight onPress={this.doSomething.bind(this)}> 3 <View> 4 <Text>I am {data.item} in a SwipeListView</Text> 5 </View> 6 </TouchableHighlight> 7)}
BAD:
1renderItem={ data => ( 2 <View> 3 <TouchableHighlight onPress={this.doSomething.bind(this)}> 4 <Text>I am {data.item} in a SwipeListView</Text> 5 </TouchableHighlight> 6 </View> 7)}
SwipeListView
now supports FlatList
and SectionList
! (as of v1.0.0)
Please see the migrating-to-flatlist doc for all details.
And see example.js
for a full usage example.
docs/
for help withexamples/
folder for examples onRN Core added a SwipeList component as of v0.27.0 It is actively being worked on and has no documentation yet. So I will continue to maintain this component until a future date.
MIT
No vulnerabilities found.
No security vulnerabilities found.