Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,23 @@ npm i react-smooth-dnd


```jsx
import React, { Component } from 'react';
import React from 'react';
import { Container, Draggable } from 'react-smooth-dnd';

class SimpleSortableList extends Component {
render() {
function SimpleSortableList(props) {
return (
<div>
<Container onDrop={this.props.onDrop}>
{this.props.items.map(item => {
<Container onDrop={props.onDrop}>
{props.items.map(item => {
return (
<Draggable key={item.id}>
{this.props.renderItem(item)}
{props.renderItem(item)}
</Draggable>
);
})}
</Container>
</div>
);
}
}
```

Expand Down Expand Up @@ -264,4 +262,4 @@ By default Draggable uses a div element for component root. You can define what
#### Parameters
- **ref** : `object` : React reference object created by *React.createRef()*
#### Returns
- **React Element**
- **React Element**