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

Lists

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 code

var 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,