dnd-kit icon indicating copy to clipboard operation
dnd-kit copied to clipboard

Issues with React 18 and `<StrictMode>` in development

Open sydth26 opened this issue 2 years ago • 2 comments

As seen in the attached video clip, I can move the items in container A to B without any problem. But if the speed of my drag increase, the list in the over container starts to behave abnormally. I tried the example multi container story but didn't capture this type of behavior.

Once the list items start to jump all over the place, if click on an item, it immediately switch place with another one, as the {over} is not itself even in dragStart.

Please help to check if this is a bug.

Sandbox: https://codesandbox.io/s/eloquent-kirch-t9r13j?file=/Dnd.js

Video: https://user-images.githubusercontent.com/83575213/170879626-de413f22-1236-4128-baec-c95363e61b47.mp4

Cheers.

sydth26 avatar May 29 '22 16:05 sydth26

I am experiencing something similar after upgrading to react 18. Your sandbox seems to work fine with react 17 https://codesandbox.io/s/admiring-allen-n1ttbb?file=/src/index.js

Let's see

0xF013 avatar Jun 06 '22 09:06 0xF013

I can replicate the issue, thanks for providing a replication CodeSandbox. Will investigate this week.

I believe the issue is related to the use of <StrictMode>.

clauderic avatar Jun 06 '22 14:06 clauderic