Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-list-drag-and-drop

Package Overview
Dependencies
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-list-drag-and-drop

**This package has not been tested on mobile browsers or React Native. SORRY!**

  • 0.9.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

React List Drag and Drop

This package has not been tested on mobile browsers or React Native. SORRY!

Build Status


React List Drag and Drop Example

React List Drag and Drop Example

Installation

npm install --save react-list-drag-and-drop

Usage

You must have an Array of items to render in your list.
Instead of rendering it inside a <div> you render it inside a <RLDD> component using a render prop.

import RLDD from 'react-list-drag-and-drop/lib/RLDD';
<RLDD
  items={items}
  itemRenderer={(item) => {
    return (
      <div className="item">{item.title}</div>
    );
  }}
  onChange={this.handleRLDDChange}
/>

Then you need to handle the onChange callback and call setState with the new list. Like this:

  private handleRLDDChange(newItems) {
    this.setState({ items: newItems });
  }

Each item must be of type Object and have an id property of type number.

You can play around with the examples

Typescript

Edit Draggable List for React + Typescript

Javascript

Edit Draggable List for React + Typescript

Keywords

FAQs

Package last updated on 16 Dec 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc