Skip to content

Commit

Permalink
docs update (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
Anan7Codes authored May 10, 2023
1 parent ff545d7 commit 64042ce
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ npm install react-easy-sort --save

```js
import SortableList, { SortableItem } from 'react-easy-sort'
import arrayMove from 'array-move'
import { arrayMoveImmutable } from 'array-move';

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

const onSortEnd = (oldIndex: number, newIndex: number) => {
setItems((array) => arrayMove(array, oldIndex, newIndex))
setItems((array) => arrayMoveImmutable(array, oldIndex, newIndex))
}

return (
Expand Down

0 comments on commit 64042ce

Please sign in to comment.