Closed sfaigan closed 6 years ago
Yes it makes sense to have multiple contexts No you cannot move something from one drag drop context to another
If you want lots of different drag and drop interactions on the page you will probably need to come up with a way of rolling up your logic into the single onDragEnd handler. You can use similar strategies to that of reducer composition
I cannot think of another way at the moment
In the documentation for react-beautiful-dnd, it says
So, I put the
DragDropContext
in my highest component in the tree,App.js
(ignoringindex.js
). However,DragDropContext
requires anonDragEnd
prop, which usually sorts the droppable and updates what items are in that droppable.In my code,
<MainView />
will contain several droppables, and<ItemList />
will contain one droppable that will contain all the draggables to begin with.Would it make more sense to have multiple DragDropContexts? One within
MainView
and another withinItemList
? Can you move a draggable between two droppables that are contained within two separate DragDropContexts?I tried using a DragDropContext in each Droppable component but I couldn't figure out how to move a draggable between DragDropContexts.
Any help is appreciated!
Thanks, Shea