Dragged item transitions back to original index, but array mutated correctly #1027
Answered
by
samesfahani-tuplehealth
samesfahani-tuplehealth
asked this question in
Q&A
-
Repro: https://stackblitz.com/edit/react-ts-2vh17j?file=ArrayView.tsx,App.tsx Video: Screen.Recording.2023-02-09.at.5.45.34.PM.movI've tried to isolate my code down as much as possible, getting rid of all other drag handlers and overlays. The final array is correct, but the animation looks very jarring and off. |
Beta Was this translation helpful? Give feedback.
Answered by
samesfahani-tuplehealth
Feb 9, 2023
Replies: 1 comment
-
Figured it out. The |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
samesfahani-tuplehealth
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Figured it out. The
key
in the render cannot and should not beindex
. Swap toitem.id
instead and it all works.