Using SortableTreeWithoutDndContext does not work
See original GitHub issueThere are two DnDs in a page.
One for the RST with external nodes, and the other for the tab swapping.
We place <DndProvider />
in top level component and
use SortableTreeWithoutDndContext in child component
to avoid two HTML backends issue.
It seems the RST renders nothing or returns null as the dragDropManager is undefined. https://github.com/frontend-collective/react-sortable-tree/blob/2a5f741d0bc965b47a8ea6764e98a13aa3e51544/src/react-sortable-tree.js#L941-L949
Is there a workaround to deal with this issue? Thank You.
Issue Analytics
- State:
- Created 3 years ago
- Comments:10
Top Results From Across the Web
javascript - Check the render method of `DragDropContext ...
I am trying to use the react-sortable-tree module in my project, but I have been having issues with importing the component into my ......
Read more >react-sortable-tree-patch-react-17 - npm
Troubleshooting. If it throws "TypeError: fn is not a function" errors in production. This issue may be related to an ongoing incompatibility ...
Read more >react-sortable-tree | Yarn - Package Manager
Works? Chrome, Yes. Firefox, Yes. Safari, Yes. IE 11, Yes. Troubleshooting. If it throws "TypeError: fn is not a function ...
Read more >pearson-react-sortable-tree/README.md - UNPKG
If not set explicitly, a default value is applied by react-sortable-tree for you ... Defaults to a function that uses the `searchQuery` string...
Read more >React-sortable-tree-modified - npm.io
https://github.com/Hovakimyan/React-Sortable-Tree-Modified/issues/6) | ## Troubleshooting ### If it doesn't work with other components that use react-dnd ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@zourbuth I had the same problem and it was because I ended up with two copies of react-dnd in my final Webpack bundle, one that I was importing and the other that react-sortable-tree imported. Because
DndContext
is a singleton, having two copies means there are two singletons! I resolved the issue for myself by ensuring Webpack resolved the react-dnd package to a single, top-level installation of react-dnd.https://webpack.js.org/configuration/resolve/#resolvealias
I was having the same problem for months now and none of the solutions worked except for @drewpc 's one https://github.com/frontend-collective/react-sortable-tree/issues/788#issuecomment-710661403 ! Thanks 😃
If anyone is interested, my webpack modification looks like this: