-
Notifications
You must be signed in to change notification settings - Fork 917
SortableTreeWithoutDndContext not work react-dnd@latest #665
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Not working for me even with [email protected]. |
It might be because of react-dnd being defined as dependency instead of peerDependency. My hunch is that context object which defines provider and consumer are actually different objects: one in-app world while other in the sortable-tree world. Hence the consumer in react-sortable is not able to see the backend provided in app world. |
Okay, yes there were two instances of react-dnd being loaded: one in-app and other in react-sortable-tree. You can use npm dedupe to force use one source for react-dnd. |
running into this issue. |
Also for me with the latest |
ok guys, a little update:
All my tree and react app come back to works, with SortableTree and SortableTreeWithoutDndContext. Maybe is react-dnd v10 issues or something related to. Seems that in 9.5.1 there is a different way to how HTML5 backends is invoked when app re-render. Hope this help the developer to have some test with v10 and v9.5.1 together, to find the difference and then fix SortableTree with the latest dnd version. If I found some other tip, I will write here. |
This got my project compiling, thanks! Also on their example you can see that they're using the default export for HTML5Backend, which isn't supported in its current version.. a little hint that they are using an out dated version |
Unfortunately, even with I'll try to investigate on my app, hope I can find something useful! |
@TdyP Did you happen to find anything useful in your investigation? I'm working on an app that is affected by this issue and downgrading to 9.5.1 for both of these libraries does not seem to avoid the blank tree rendering issue. |
@jaydavid unfortunately no. Didn't manage to get this working so I had to found a workaround in my app to avoid the situation where I need this |
@TdyP bummer - thanks for the response though! Hopefully before too long the bug is fixed but if I find a workaround or the source of why the downgrade isn't working I'll send an update. |
@TdyP As an update (though probably not helpful) I was eventually able to get the underlying dnd context to be shared using the workaround listed above. I'm guessing it was originally my error that the downgrade did not work, but after coming back to this a little while later and manually clearing things out (and restarting vscode) I was able get a fresh install to behave as expected. Hopefully you don't end up needing to revisit this before the issue is addressed. |
I finally had to use it, so digged out a little more. Upgrading |
Ah, already fixed this issue, I still having problem using SortableTreeWithoutDndContext. |
You saved my work. All replies above did not applied but The cause of problem was just same as you mentioned. Thank you |
Hi, i have code:
App.js
Tree.js
if I try [email protected] then it does not work (render null), but if I try react-dnd@9.5.1 then everything works
The text was updated successfully, but these errors were encountered: