Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hzzcc/react-native-draggablelist
https://github.com/hzzcc/react-native-draggablelist
Last synced: 22 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/hzzcc/react-native-draggablelist
- Owner: hzzcc
- Created: 2015-12-30T00:26:11.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-06-11T12:31:43.000Z (about 8 years ago)
- Last Synced: 2024-05-11T15:20:26.153Z (about 2 months ago)
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/react-native-draggablelist
- Size: 296 KB
- Stars: 26
- Watchers: 3
- Forks: 3
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Lists
- react-native-awesome - react-native-draggablelist
- awesome-react-native - react-native-draggablelist
README
# react native draggableList
## Demo
![demo](https://raw.githubusercontent.com/hzzcc/react-native-dragablelist/master/Image/example.gif)## How do I use it?
### Installation
npm install react-native-draggablelist
### Use in your codevar DraggableList = require('react-native-draggablelist');
dataSource: isRequired, array of your data include id, like [{id: '1', name: ''}, {id: '2', name: ''}]
component: isRequired, your cell component
onMove: callback function, return the orders of cell by id
keys: you can also pass data orders, like ['2','1'], but it should be same with your data ids
shouldUpdateId: the cell should be update
onPressCell: when cell pressed
isScrollView: is scrollView or view,
toggleScroll: if isScrollView is false, and outside component is a scrollView, should set the callback for scrollEnabled state
shouldUpdate: update all cell#### Simplest sample use is :
### Attention
In your cell component, you should add below to your view
{/* other views*/}
{/* this is the rect you can drag*/}
{/* other views*/}
this.props.rowData, you can get the data passed to cell,