Skip to content

Convert usage code to func component in README.md file #85

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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**