Skip to content

Commit

Permalink
Merge branch 'dev' of github.com:cheton/react-sortable into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
cheton committed Jun 27, 2016
2 parents d00cf12 + 09efa08 commit f12506f
Show file tree
Hide file tree
Showing 4 changed files with 15,473 additions and 14,908 deletions.
16 changes: 14 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,21 @@ Then, include these scripts into your html file:
</body>
```

Use <b>&lt;ReactSortable /&gt;</b> instead of <b>&lt;Sortable /&gt;</b> in your JSX code since the Sortable library will export a <b>window.Sortable</b> object if you're running JSX code directly in the browser. For example:
```js
<ReactSortable
tag="ul"
onChange={(order) =>
this.props.onChange(order);
}}
>
{items}
</ReactSortable>
```

## Usage
File: sortable-list.jsx
```jsx
```js
import React from 'react';
import Sortable from 'react-sortablejs';

Expand Down Expand Up @@ -99,7 +111,7 @@ export default SortableList;
```

File: index.jsx
```jsx
```js
import React from 'react';
import ReactDOM from 'react-dom';
import SortableList from './sortable-list';
Expand Down
6 changes: 6 additions & 0 deletions examples/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"presets": ["es2015", "stage-0", "react"],
"plugins": [
"transform-decorators-legacy"
]
}
Loading

0 comments on commit f12506f

Please sign in to comment.