Skip to content

telldus/react-native-drag-and-drop-scroll-view

Repository files navigation

react-native-drag-and-drop-scroll-view

Drag and Drop supported dynamic scrollview for react-native. Inspired by react-native-draggable-dynamic-flatlist.

Getting started

$ npm install react-native-drag-and-drop-scroll-view --save

Mostly automatic installation

$ react-native link react-native-drag-and-drop-scroll-view

Usage

import {TouchableOpacity} from 'react-native';
import DragAndDropScrollView from 'react-native-drag-and-drop-scroll-view';

const Screen = (props) => {
    const _onSortOrderUpdate = (data) => {
    }

    const _renderRow = ({move, moveEnd, item}) => {
        return (
            <TouchableOpacity
            onLongPress={move}
            onPressOut={moveEnd}>
            ..........
            </TouchableOpacity>
        )
    }

    return (
        <DragAndDropScrollView
        data={['1', '2']}
        renderItem={_renderRow}
        onSortOrderUpdate={_onSortOrderUpdate}/>
    );
}

About

Drag and Drop supported dynamic scrollview for react-native.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published