React Drag and Drop Library
Unanswered
Cape lion posted this in #help-forum
Cape lionOP
Hey! currently I looking for a good drag and drop library for react, to use into our dashboard. we want to have multiple selectable components, which can be added to the dashboard & then moved around the page. we need to save and load the layout. anyone has experience with a specific one?
9 Replies
I’ve used DnD Kit (Not in a dashboard context tho) and it’s so easy to use, and it’s powerful.
Peterbald
DND Kit has an issue where it re-renders all components when moving/dragging an item, so it's better off using pragmatic dnd, beautiful dnd (deprecated) or something else.
don't use DND Kit until they resolve the issue.
Cape lionOP
understand, does all of the mentioned ones support retrieving a json to save the layout & load a layout?
Peterbald
no, why would they include such capability, these are drag and drop libraries.
do you use react/tanstack query to fetch data? no. you use it to manage async state.
you fetch data with your server action or any other http function.
Dutch Smoushond
i've used https://www.npmjs.com/package/react-beautiful-dnd, not a very good experience
@Peterbald you fetch data with your server action or any other http function.
Cape lionOP
yes, obviously. i just meant that there is a json object or something, to get the current layout