Skip to content

Commit 64042ce

Browse files
authored
docs update (#34)
1 parent ff545d7 commit 64042ce

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,13 @@ npm install react-easy-sort --save
4747

4848
```js
4949
import SortableList, { SortableItem } from 'react-easy-sort'
50-
import arrayMove from 'array-move'
50+
import { arrayMoveImmutable } from 'array-move';
5151

5252
const App = () => {
5353
const [items, setItems] = React.useState(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I'])
5454

5555
const onSortEnd = (oldIndex: number, newIndex: number) => {
56-
setItems((array) => arrayMove(array, oldIndex, newIndex))
56+
setItems((array) => arrayMoveImmutable(array, oldIndex, newIndex))
5757
}
5858

5959
return (

0 commit comments

Comments
 (0)