From 64042ce98106af475a3ff5ca858f0af5263a6b93 Mon Sep 17 00:00:00 2001 From: anand7u <37017231+Anan7Codes@users.noreply.github.com> Date: Wed, 10 May 2023 21:11:38 +0400 Subject: [PATCH] docs update (#34) --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c32a295..3e845dd 100644 --- a/README.md +++ b/README.md @@ -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 (