Тёмный

Build React Drag N Drop With Dnd Kit 

Monsterlessons Academy
Подписаться 47 тыс.
Просмотров 27 тыс.
50% 1

Опубликовано:

 

20 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 57   
@MonsterlessonsAcademy
@MonsterlessonsAcademy Месяц назад
WATCH NEXT: React Interview Questions and Answers - Dominate Your Next Interview - ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-yQHr4opz_N0.htmlsi=51b2XP_84GH3q6oF
@saurabh75prakash
@saurabh75prakash Месяц назад
One of the best dnd kit tutorial on yt. Thanks ❤
@MonsterlessonsAcademy
@MonsterlessonsAcademy Месяц назад
Glad it was helpful!
@ramoreacher5322
@ramoreacher5322 9 месяцев назад
You saved me thanks a lot. Very good tutorial, well explained. I'm going to sub to see more of your content. Keep the good work !
@MonsterlessonsAcademy
@MonsterlessonsAcademy 9 месяцев назад
Awesome, thank you!
@ohmyumbrella
@ohmyumbrella 8 месяцев назад
does the dnd-kit not allow normal clicks on the list items ? My click event handlers stopped working after wrapping with Dndcontext
@mustafabeklevic5831
@mustafabeklevic5831 2 месяца назад
I encountered the same problem and I used "onMouseDown" instead. It worked.
@iamemiliahhhh
@iamemiliahhhh 11 месяцев назад
Great tutorial! I'm building a Kanban Board, please can you make a video on how to use this kit to drag a task from one column to another?
@MonsterlessonsAcademy
@MonsterlessonsAcademy 11 месяцев назад
I will add it to the list of ideas.
@AFTstorm
@AFTstorm 4 месяца назад
oh my god this is SO MUCH BETTER than react-dnd
@MonsterlessonsAcademy
@MonsterlessonsAcademy 4 месяца назад
Yeap
@real23lions
@real23lions 7 месяцев назад
Thanks for that intro. I wanted to know if drag and drop is possible in reactjs.
@MonsterlessonsAcademy
@MonsterlessonsAcademy 7 месяцев назад
You are welcome!
@jamesyu6385
@jamesyu6385 5 месяцев назад
thaks for this great tut!!! any typescript version??
@MonsterlessonsAcademy
@MonsterlessonsAcademy 5 месяцев назад
Not really, but just convert it to TS
@thebks1
@thebks1 5 месяцев назад
Can this functionality also be applied to a grid? I'm currently working on a dashboard project where I need to implement drag-and-drop and resizing for the metrics displayed in the dashboard. I'm using the Grid component from Material UI.
@MonsterlessonsAcademy
@MonsterlessonsAcademy 5 месяцев назад
I didn't try it with the grid but I don't see why it would not work. You can drag and drop anything with it.
@thebks1
@thebks1 5 месяцев назад
@@MonsterlessonsAcademy I did try using `react-grid-layout` but it works well with class based components and react official documentation doesn't recommend using class components. Will give it a try and I would love to see a video on using it with the Grid. Thank you.
@muhammadsalmanmuhammadsalm7025
@muhammadsalmanmuhammadsalm7025 7 месяцев назад
1- I wanted to know if drag and drop is possible in reactjs. ? 2- My click event handlers stopped working after wrapping with Dndcontext
@svitlanaiordatii7022
@svitlanaiordatii7022 5 месяцев назад
OMG, this is heaven, thank you so much!
@MonsterlessonsAcademy
@MonsterlessonsAcademy 5 месяцев назад
You're so welcome!
@Uguru-John
@Uguru-John 11 месяцев назад
Finally found one that works thanks
@MonsterlessonsAcademy
@MonsterlessonsAcademy 11 месяцев назад
Glad I could help!
@FGA-47
@FGA-47 8 месяцев назад
Thanks a lot! That was very helpful.
@MonsterlessonsAcademy
@MonsterlessonsAcademy 8 месяцев назад
You're welcome!
@aleksandr95
@aleksandr95 Год назад
Not bad. Now I'm waiting for the same lesson on Angular ;)
@MonsterlessonsAcademy
@MonsterlessonsAcademy Год назад
Will come!
@hamza201183
@hamza201183 Год назад
Hi Oleksandr, thank you very much. I always wanted to know how page builders (Elementor, or in Shopify...) work with drag&drop, especially how do they save the state (so that when we re-open the page, all the components we built are saved). Do they persist the whole resulting html? Or do they persist a model and re-create the html dynamically out of that model? I'm very curious and would be happy to learn from your experience :)
@MonsterlessonsAcademy
@MonsterlessonsAcademy Год назад
I have no idea as I never used them. But I assume it is either local storage or API. In a big project it is for sure API as local storage it really limited. Which means which every drag/change/add on client side they send a request to API with information how all elements are located and their positions. Then on page reload this information is loaded from API and elements are positioned accordingly.
@hamza201183
@hamza201183 Год назад
​@@MonsterlessonsAcademy Ok many thanks! I'm thinking since many weeks how something like this could be implemented (just by curiosity) :)
@niallmurphy2163
@niallmurphy2163 14 дней назад
react-beautiful-dnd, which is mentioned at the start of this video, has become pragmatic-drag-and-drop which is under very active development and isn't specific to react anymore.
@MonsterlessonsAcademy
@MonsterlessonsAcademy 13 дней назад
Great!
@premmourya7060
@premmourya7060 11 месяцев назад
on click is not working on draggable item
@mustafabeklevic5831
@mustafabeklevic5831 2 месяца назад
I encountered the same problem and I used "onMouseDown" instead. It worked.
@logancoale6505
@logancoale6505 Год назад
Thanks for this! Very helpful.
@MonsterlessonsAcademy
@MonsterlessonsAcademy Год назад
You're welcome!
@itzadetunji
@itzadetunji 3 месяца назад
@@MonsterlessonsAcademy Thanks alot, this was really good. You deserve a sub 🎉
@sheikhakbar2067
@sheikhakbar2067 Год назад
Nice Work MonsterlessonsAcademy; you have no idea I wasted the last 3 weeks trying to learn react beautiful dnd and it lacks documentations. I tried to use chatgpt to learn it, no use.... dnd-kit seems promising but it's like 2 years old only.
@MonsterlessonsAcademy
@MonsterlessonsAcademy Год назад
Indeed. Finding a good lib is a pain.
@adityaptrp_
@adityaptrp_ Год назад
why my project got flicker after update the users state (the component is re-rendered), and you are not facing the same thing like me?
@MonsterlessonsAcademy
@MonsterlessonsAcademy Год назад
No idea. You need to debug that.
@iamanupambiswas
@iamanupambiswas Год назад
@MonsterlessonsAcademy How can we store the new position information in a postgres database? If my initial list was obtained from the same database
@sroger
@sroger Год назад
@iamanupambiswas To achieve that, you can create a column named “sort_index” in the database. In your React app, you can create a hidden input with the same name and set its “value” attribute to “index”. When the onDragEnd function is triggered, you can make a call to the database to update all the elements on the list. To avoid calling the database too frequently, it’s recommended to use a debouncing function. Any questions, let me know.
@appstuff6565
@appstuff6565 Год назад
hey thanks for this, i am in a similar issue. I am trying a linktree clone with supabase tables "users" and "links" as a learning experiment. I am using NextJS with Supabase. Right now im at a stage on how do i persist data to display links for a specific user as each user will have its own sorting arrangement. How do you think i should go about it? All links are in "links" table and i get them from the user that requests it accordingly. any help is appreciated.
@uvy.studios
@uvy.studios Год назад
What color theme are you using in this video?
@MonsterlessonsAcademy
@MonsterlessonsAcademy Год назад
It's gruvbox
@appstuff6565
@appstuff6565 Год назад
hey thanks for this, i am in a similar issue. I am trying a linktree clone with supabase tables "users" and "links" as a learning experiment. I am using NextJS with Supabase. Right now im at a stage on how do i persist data to display links for a specific user as each user will have its own sorting arrangement. How do you think i should go about it? All links are in "links" table and i get them from the user that requests it accordingly. any help is appreciated.
@MonsterlessonsAcademy
@MonsterlessonsAcademy Год назад
No idea, as you have a super specific problem which is not related to this video.
@przeqpiciel
@przeqpiciel 7 месяцев назад
i have watched this tut for approx 7 times, and I have no idea why I cant get drag and drop in my project
@MonsterlessonsAcademy
@MonsterlessonsAcademy 7 месяцев назад
Did you check the source code under the video and compare it to yours?
@farhadjaman5580
@farhadjaman5580 11 месяцев назад
why having hook in dnd is so important?
@MonsterlessonsAcademy
@MonsterlessonsAcademy 11 месяцев назад
Because nowadays all libs are written with hooks and they are a reusable way to implement things. It's not mandatory but other libs had bad API or were deprecated. For example there is zero sense to use render props approach in React nowadays.
@MazanLabeeb
@MazanLabeeb 10 месяцев назад
that was super easy
@MonsterlessonsAcademy
@MonsterlessonsAcademy 10 месяцев назад
Glad to hear that!
@erdauletbayangali7470
@erdauletbayangali7470 8 месяцев назад
THANKS. VERY WELL
@MonsterlessonsAcademy
@MonsterlessonsAcademy 8 месяцев назад
You are welcome
@ayoubahabchane
@ayoubahabchane Год назад
A godsend 💙 +1 Sub
Далее
A New Drag And Drop Library For EVERY Framework
16:02
Просмотров 153 тыс.
React Drag And Drop (dnd-kit) | Beginners Tutorial
17:27
Drag and Drop with react-beautiful-dnd
58:31
Просмотров 59 тыс.
React Drag and Drop List Sort Tutorial
9:54
Просмотров 20 тыс.
Get started with Appwrite + React - Fullstack App
41:14
This React Library Scares Me...
3:05
Просмотров 43 тыс.
You might not need useEffect() ...
21:45
Просмотров 165 тыс.