J
J
John Frontend-DEV2020-05-26 21:57:44
JavaScript
John Frontend-DEV, 2020-05-26 21:57:44

How to do drag & drop with React for cards?

There is a certain list of elements, let's say these are product cards. They are numbered 1 to the nth number (in my case it is 4 elements)

How to make it so that you can swap them?? For example, 1 card with 4 or 4 with 3, etc. etc.

Link to codesandbox.io

Thank you in advance, those who decided to help somehow

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Pavel Didenko, 2020-05-26
@Dasslier

Connect the react-dnd or react-beautiful-dnd library, read the documentation and voila

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question