Skip to content

Commit f12506f

Browse files
committed
Merge branch 'dev' of github.com:cheton/react-sortable into dev
2 parents d00cf12 + 09efa08 commit f12506f

File tree

4 files changed

+15473
-14908
lines changed

4 files changed

+15473
-14908
lines changed

README.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,21 @@ Then, include these scripts into your html file:
4242
</body>
4343
```
4444

45+
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:
46+
```js
47+
<ReactSortable
48+
tag="ul"
49+
onChange={(order) =>
50+
this.props.onChange(order);
51+
}}
52+
>
53+
{items}
54+
</ReactSortable>
55+
```
56+
4557
## Usage
4658
File: sortable-list.jsx
47-
```jsx
59+
```js
4860
import React from 'react';
4961
import Sortable from 'react-sortablejs';
5062

@@ -99,7 +111,7 @@ export default SortableList;
99111
```
100112

101113
File: index.jsx
102-
```jsx
114+
```js
103115
import React from 'react';
104116
import ReactDOM from 'react-dom';
105117
import SortableList from './sortable-list';

examples/.babelrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"presets": ["es2015", "stage-0", "react"],
3+
"plugins": [
4+
"transform-decorators-legacy"
5+
]
6+
}

0 commit comments

Comments
 (0)