dnd icon indicating copy to clipboard operation
dnd copied to clipboard

Support react v18

Open 100terres opened this issue 2 years ago โ€ข 29 comments

Everything that need to be done in order to support react v18 will be tracked in this issue. You can also have a look at the React v18 milestone.

We are in the early stage of the investigation, so the list is not yet exhaustive. New issue will be added as we discover them.

  • [x] https://github.com/react-forked/dnd/issues/319
  • [x] https://github.com/react-forked/dnd/issues/318
  • [ ] https://github.com/react-forked/dnd/issues/320
  • [ ] https://github.com/react-forked/dnd/issues/317

100terres avatar Apr 04 '22 02:04 100terres

Yes please!!

antoinejaussoin avatar Apr 09 '22 12:04 antoinejaussoin

The work is in progress. I'll try to have something working as soon as possible :slightly_smiling_face:

100terres avatar Apr 09 '22 16:04 100terres

That's awesome, thanks for the work!! Let me know if I can help with testing in a real-world project.

antoinejaussoin avatar Apr 09 '22 17:04 antoinejaussoin

Would this include support for strict mode or should we create a new issue for that.

Currently using <React.StrictMode> with react 18 is not working.

jacokok avatar Apr 10 '22 11:04 jacokok

Would this include support for strict mode or should we create a new issue for that.

@jacokok it feels like something we'll investigate separately. I'll open a new issue to see how we could support strict mode.

100terres avatar Apr 10 '22 16:04 100terres

@jacokok I've updated the description of the issue to include strict mode support.

100terres avatar Apr 10 '22 16:04 100terres

Would this include support for strict mode or should we create a new issue for that.

Currently using <React.StrictMode> with react 18 is not working.

Actually that was mainly what I was interested in. Good luck with the work!

antoinejaussoin avatar Apr 10 '22 17:04 antoinejaussoin

The migration from Enzyme to @testing-library/react is going well. There is only one file to refactor. You can follow the progress here: https://github.com/react-forked/dnd/pull/323

I'll work start to work on Run test suite for react v16, v17 and v18 real soon :slightly_smiling_face:

100terres avatar Apr 13 '22 04:04 100terres

The migration from Enzyme to @testing-library/react is done :heavy_check_mark:

Next step: Run test suite for react v16, v17 and v18 :slightly_smiling_face:

100terres avatar Apr 14 '22 03:04 100terres

Any news on this ๐Ÿ™‚ we are blocked with our upgrading to react 18๐Ÿ™‰

Domino987 avatar May 28 '22 19:05 Domino987

~It's been a while. Any progress on this?๐Ÿ™‚~

For anyone want a dnd, stop waiting and try this https://github.com/clauderic/dnd-kit Not easy to use, but very powerful.

Toshinaki avatar Jul 13 '22 16:07 Toshinaki

Any news?

AlimovSV avatar Jul 18 '22 08:07 AlimovSV

Pretty the only reasonable choice is for one of us lurkers to finish the work here, or move to react-dnd...

AntonOfTheWoods avatar Jul 18 '22 13:07 AntonOfTheWoods

~It's been a while. Any progress on this?๐Ÿ™‚~

For anyone want a dnd, stop waiting and try this https://github.com/clauderic/dnd-kit Not easy to use, but very powerful.

dnd-kit does not support touch. So no option

Pretty the only reasonable choice is for one of us lurkers to finish the work here, or move to react-dnd...

I think if someone had the ability to do this, it would have been done by now.

Paul6552 avatar Jul 19 '22 07:07 Paul6552

dnd-kit does not support touch. So no option

I tested it and it did support touch I am pretty sure. The issue I found was it also does not work in react strict mode yet. (So I did not want to migrate and just have the same issue)

I think if someone had the ability to do this, it would have been done by now.

It would be interesting to see if dnd-kit can solve the strict mode problem.

For now it will be amazing if we could get a beta release of this package with the react 18 packages fix so we can stop running npm --force

jacokok avatar Jul 19 '22 09:07 jacokok

dnd-kit does not support touch. So no option

I tested it and it did support touch I am pretty sure. The issue I found was it also does not work in react strict mode yet. (So I did not want to migrate and just have the same issue)

I think if someone had the ability to do this, it would have been done by now.

It would be interesting to see if dnd-kit can solve the strict mode problem.

For now it will be amazing if we could get a beta release of this package with the react 18 packages fix so we can stop running npm --force

Well, I'm in strict mode and using dnd-kit without any problem; no console warnings and everything worked.

What's the issue you found?

Toshinaki avatar Jul 19 '22 11:07 Toshinaki

What's the issue you found?

Honestly I did not test it with strict mode because I saw this issue. https://github.com/clauderic/dnd-kit/issues/775

Edit: Tested with strict mode and it works. Even on mobile with touch. Maybe it is time to call it and migrate.

jacokok avatar Jul 19 '22 12:07 jacokok

@Toshinaki , the issue https://github.com/clauderic/dnd-kit/issues/775 is exactly the same as everyone (maybe except react-dnd?) on React 18. There are open issues, maintainer says "I'll get on to it", then nothing for many months. Obviously others aren't quite as bad as this repo in terms of silence from the maintainer but one of us is going to have to take responsibility here...

AntonOfTheWoods avatar Jul 20 '22 05:07 AntonOfTheWoods

@AntonOfTheWoods I'm not interested in arguing about responsibility or something here. But I'm waiting for my dinner so I can explain myself a bit.

Some people like me don't care about what we use, but just want to get the work done. For my personal project, I was using react-beautiful-dnd and bothered with this issue, and this directed me here.

I asked for progress, but got no response. So I quitted waiting. I found dnd-kit, and it worked for my purpose, no errors nor warnings, so I recommended. End of the story.

It works for you, great, use it; not working? idc

I appreciate๐Ÿงก this and other open source great works, and that's all.

Toshinaki avatar Jul 20 '22 10:07 Toshinaki

@Toshinaki , ok, sorry I missed that it's a drop-in replacement. That is very interesting! Having to reimplement most of the logic can make moving to another lib a massive hassle but if dnd-kit is just point to the new lib and "It Works!", then that is definitely awesome, thanks!

AntonOfTheWoods avatar Jul 20 '22 11:07 AntonOfTheWoods

@Toshinaki , ok, sorry I missed that it's a drop-in replacement. That is very interesting! Having to reimplement most of the logic can make moving to another lib a massive hassle but if dnd-kit is just point to the new lib and "It Works!", then that is definitely awesome, thanks!

I migrated to dnd-kit. It was not a drop in replacement. It took me a bit longer than anticipated, but works really well.

Check out this comment https://github.com/atlassian/react-beautiful-dnd/issues/2399#issuecomment-1167427762 on getting this lib to work with strict mode.

jacokok avatar Jul 21 '22 06:07 jacokok

I migrated to dnd-kit. It was not a drop in replacement. It took me a bit longer than anticipated, but works really well.

Im trying to do the same now and struggling with getting click events to work with dnd-kit.

Will-Babbitt avatar Jul 27 '22 13:07 Will-Babbitt

Sorry for keeping you all waiting! :grimacing: I'm still trying to find the time to make it work, but as many of you might have notice it's not an easy fix... and it will take a lot of my free time (outside of work) to support react v18.

I still plan on making it work in the upcoming months, because I need this for a personal project and for work. But if you are in a rush to migrate your codebase to react v18 then I would suggest to not wait for react-forked/dnd to support the latest version of react and move to another library.

If anyone has the time to to do all the refactoring needed I'll be more then happy to review your pull request!

Sorry again and I hope you understand.

100terres avatar Aug 12 '22 05:08 100terres

@100terres I'm using react-beautiful-dnd for a few projects that required react 18 and I wasn't sure how progress was coming along so I forked your work and released @hello-pangea/dnd which supports react 18 and strict mode.

We needed our own fork so we could develop new features with a semi-regular cadence, and I intend to further develop the library there.

It would never have been possible without your truly amazing work on the original react-beautiful-dnd. I cannot thank you enough for what you've accomplished here. And no worries on being caught up with life stuff, you don't owe anyone anything. I've certainly left some github issues open for much longer than I'd like before, it happens.

Xhale1 avatar Aug 13 '22 08:08 Xhale1

@100terres I'm using react-beautiful-dnd for a few projects that required react 18 and I wasn't sure how progress was coming along so I forked your work and released @hello-pangea/dnd which supports react 18 and strict mode.

We needed our own fork so we could develop new features with a semi-regular cadence, and I intend to further develop the library there.

It would never have been possible without your truly amazing work on the original react-beautiful-dnd. I cannot thank you enough for what you've accomplished here. And no worries on being caught up with life stuff, you don't owe anyone anything. I've certainly left some github issues open for much longer than I'd like before, it happens.

It would have saved me a couple of very annoying days of work if you had posted about this work a couple of weeks ago!

AntonOfTheWoods avatar Aug 13 '22 15:08 AntonOfTheWoods

It would have saved me a couple of very annoying days of work if you had posted about this work a couple of weeks ago!

Haha, timing could have been a bit better. Did you end up migrating to dnd kit? If so how do you like it compared to react beautiful dnd?

Xhale1 avatar Aug 13 '22 21:08 Xhale1

Hi all,

I've been watching this issue closely, and I would just like to add a few thoughts:

I am using react-beautiful-dnd for one of my projects, and maybe the most important reason I chose it is how natural the interactivity feels. This is best explained in Alex Reardon's blog post that introduces the library:

In react-beautiful-dnd a dragging item's impact is based on its centre of gravity โ€” regardless of where a user grabs an item from. A dragging items impact follows similar rules to a set of scales โš–๏ธ.

This is a mechanic I feel like most other DND libraries get wrong, and something that's largely unique to RBDND. However, it seems that dnd-kit also implements the same behavior, if you play with their examples. So I am encouraged in that respect, in that I might be able to switch to dnd-kit without sacrificing a natural UX.

Of course, it would be great to see react-forked/dnd gain React 18 support, but in the interim, dnd-kit may prove to be a worthy alternative.

caleb531 avatar Aug 13 '22 23:08 caleb531

Of course, it would be great to see react-forked/dnd gain React 18 support, but in the interim, dnd-kit may prove to be a worthy alternative.

@caleb531 I created a fork of this which supports react 18 (it's like two comments up ๐Ÿ™‚)

@hello-pangea/dnd

https://github.com/hello-pangea/dnd

Xhale1 avatar Aug 13 '22 23:08 Xhale1

Haha, timing could have been a bit better. Did you end up migrating to dnd kit? If so how do you like it compared to react beautiful dnd?

@Xhale1 react-dnd. I found examples pretty close to what I needed so just went with that. I also found that the touch version actually works fine for the browsers I need on the desktop, so that made things a little simpler. I haven't actually pushed to prod yet though so might even just bite the bullet on that if yours works out of the box migrating from react-beautiful-dnd!

AntonOfTheWoods avatar Aug 14 '22 23:08 AntonOfTheWoods

Hi @Xhale1

I'm using react-beautiful-dnd for a few projects that required react 18 and I wasn't sure how progress was coming along so I forked your work and released @hello-pangea/dnd which supports react 18 and strict mode.

Happy to see that you've managed to make it work with react 18! I'll have a look at what you did :slightly_smiling_face: Maybe you've found and fix the issue I was stuck on!

It would never have been possible without your truly amazing work on the original react-beautiful-dnd. I cannot thank you enough for what you've accomplished here.

It was a lot of late night coding, but it was really fun to do. I've learned so much by migrating the repo from Flow to TypeScript and more. Thank you for this recognition :slightly_smiling_face:

I might try reach you in the upcoming days!

100terres avatar Aug 17 '22 02:08 100terres