Drag and Drop in React with React Beautiful DnD

Поделиться
HTML-код
  • Опубликовано: 4 фев 2025
  • НаукаНаука

Комментарии • 434

  • @colbyfayock
    @colbyfayock  6 месяцев назад

    Learn how to build a full stack Next.js app in my upcoming course: colbyfayock.com/course

  • @alma-powell
    @alma-powell 3 года назад +64

    This is one of the best React Library tutorials I've seen. Quick, understandable, and concise. Very impressive.

  • @rauldeandrade
    @rauldeandrade 3 года назад +33

    I watched several half hour plus tutorials on this lib that just left me more confused than when i started, before coming here.
    6 minutes and super simple and clear explanation. I wish every tutorial was like this. Thanks!

    • @colbyfayock
      @colbyfayock  3 года назад +2

      ah thanks! glad it helped out

  • @ivangunchev4782
    @ivangunchev4782 3 года назад +7

    I am pretty sure that this should be the way most tutorials should be executed - eloquent, straight to the point, referencing the documentation, no bs before and after. Hats off to you, Colby. You've gained a sub :)

  • @AbhirupGhoshPiano
    @AbhirupGhoshPiano Год назад +1

    Has to be the best tutorial I've seen about this library. Quick, concise, easy to understand.

    • @colbyfayock
      @colbyfayock  Год назад

      thanks appreciate the kind words!

  • @cgfx360
    @cgfx360 4 года назад +4

    I went through a metric ton of extremely complicated and complex videos describing implementing this, and could not figure it out. Your video was ridiculously easy to follow and very clear. Thank you!

    • @colbyfayock
      @colbyfayock  4 года назад

      no problem, so glad to hear that! thanks for checking it out :D

  • @kirklayer2023
    @kirklayer2023 3 года назад +4

    This is just what I needed. Thanks for making the 5-min video. Yours is better than the official github doc

  • @iwanpieterse6953
    @iwanpieterse6953 2 года назад +2

    A breath of fresh air. Clear, concise, and easy to understand. Thank you for making this.

  • @icecruiserr
    @icecruiserr 4 года назад +26

    Excellent tutorial and loved how it got straight to the point! Thanks again

  • @hyfydistro
    @hyfydistro 3 года назад +6

    Thanks flipping much! This was succinct and kind of thorough. I would advise people to be aware of the data types accepted. ``'s property `draggableId` only accepts strings! Otherwise, you'd keep getting an error that `draggableId` does not have an ID! That tripped me!

    • @colbyfayock
      @colbyfayock  3 года назад

      haha no problem! glad you got it figured out

  • @Buffnerd_i
    @Buffnerd_i 2 года назад +1

    I love you man, straight to the point,no bullshit, explaining how everything works, I even managed to NOT fuck it up and have 0 errors.
    You got my like and subscribe.

    • @colbyfayock
      @colbyfayock  2 года назад

      thank you! 🙌💯 awesome to hear 💪

  • @leonardocitton4627
    @leonardocitton4627 3 года назад +3

    Wow, best coding videos in YT! Fast, coincise and well organised... Congrats!

    • @colbyfayock
      @colbyfayock  3 года назад

      Thanks for the kind words Leonardo!! 🙏

  • @arProject.webdev
    @arProject.webdev 5 месяцев назад

    3 years later you still save my life, thanks alot

  • @owfuldev
    @owfuldev Год назад

    Hi, Colby! Thank you for this tutorial and I just wanna tell you that you are one of the best content creators here that I love to follow! Your contents are really on top, easy to understand, simple, and I just CLICK! After my first time watching your video a while ago, I keep coming back. I'm not sugarcoating, but you are indeed one of the best! Hope one day I can meet you because YOU ARE ONE OF MY FAV DEVS!!!
    Please keep making contents!

    • @colbyfayock
      @colbyfayock  Год назад

      thank you for the kind word!! 🙌

  • @theAsyncGuy
    @theAsyncGuy 4 месяца назад

    No extra talk. Straight to the point. I like it.

  • @jethrotalavera3314
    @jethrotalavera3314 3 года назад +1

    Life saver needed to add a D n D feature for work. Thank you

  • @colbyfayock
    @colbyfayock  4 года назад +5

    Next, learn how to add Chakra UI components to a React app ruclips.net/video/ubB5l-HVPgY/видео.html
    Make sure to subscribe for more! ruclips.net/user/colbyfayock

  • @holyfreakinguacamole
    @holyfreakinguacamole Год назад

    Just heard you on Syntax (on which you mentioned React Beautiful DnD!). Well it just so happens that I'm building out a test-project for my first web-dev job, and a *bonus* feature is that I make a list drag-and-droppable!!! woot woot! Here we go! Thanks, Colby :)

    • @colbyfayock
      @colbyfayock  Год назад

      haha good timing! glad it helped :D

  • @naimurrahman9979
    @naimurrahman9979 2 года назад

    Sweet little video to userstand everything perfectly.. No extra talking, just clear instructions.. Awesome!

  • @raifaustino
    @raifaustino 2 года назад

    Great tutorial! 6 minutes cutting straight to the chase instead of dabbling on the IDE for half an hour. Thanks!!

  • @alexmcclay8152
    @alexmcclay8152 2 года назад +1

    Havn't tried to implement it yet on my app, but this video was quick and to the point, thanks!

  • @foo3268
    @foo3268 2 года назад

    thanks brother, I like how you edited the awkward silence and typing out.

    • @colbyfayock
      @colbyfayock  2 года назад

      Definitely lots of awkward silences 😂 glad you enjoyed it

  • @goethe1776
    @goethe1776 3 года назад

    Damn, so much concise information in under 6m, that's just beautiful man...

  • @BbB-vr9uh
    @BbB-vr9uh 2 года назад

    Great tutorial! Love that show the docs while you explain the imported things, then show the code update you make with it.

  • @taeloseholoba3490
    @taeloseholoba3490 Год назад

    damn that's a very insightful tutorial, you won't believe it's only 6 minutes thank you Colby

  • @aviraljain8785
    @aviraljain8785 Год назад

    Bro this video is so simple and easy to understand. Finally after long searching for drag and drop this video ends my searching. Thank you so much.❣

    • @colbyfayock
      @colbyfayock  Год назад

      really happy to hear that! no problem :)

  • @evanbero9705
    @evanbero9705 2 года назад +2

    Great job of explaining. Works perfectly. I've seen some other videos that overcomplicate dnd. This is great, thank you.

  • @petakirikiri4074
    @petakirikiri4074 6 месяцев назад

    What a great video. Nice and concise and to the point, well edited thanks for that it was really helpful.

    • @colbyfayock
      @colbyfayock  5 месяцев назад

      thanks, happy to hear that! 🙌

  • @miodice3
    @miodice3 4 года назад +2

    awesome video, will try to implement this later today. thanks for taking the time to assemble this and post it, its very clear

  • @simonbeverskog1784
    @simonbeverskog1784 4 года назад +4

    Really great video! You explained it very clearly and it was easy to follow along even as a beginner, big thumbs up and keep it up!

  • @moryakantha5782
    @moryakantha5782 10 месяцев назад

    I was coding a ToDo List app with NextJs and wanted to implement this dnd stuff and this was very helpful

    • @colbyfayock
      @colbyfayock  10 месяцев назад

      awesome! glad it helped 🙌

  • @karlo768
    @karlo768 2 года назад

    Love this tutorial, good fast pace, no time wasted!

  • @NickReisenauer
    @NickReisenauer 4 года назад +3

    That was pretty cool! I've never worked with drag-and-drop before

    • @colbyfayock
      @colbyfayock  4 года назад

      yeah! drag and drop is awesome and it's not too bad to set up. can make for some really interactive features in an app

  • @realdevdiv
    @realdevdiv Год назад +4

    if you are having problems with the id not found. Replace with:
    export const StrictModeDroppable = ({ children, ...props }: DroppableProps) => {
    const [enabled, setEnabled] = useState(false);
    useEffect(() => {
    const animation = requestAnimationFrame(() => setEnabled(true));
    return () => {
    cancelAnimationFrame(animation);
    setEnabled(false);
    };
    }, []);
    if (!enabled) {
    return null;
    }
    return {children};
    };

  • @vladimiregorov6875
    @vladimiregorov6875 3 года назад +1

    Thank you very much man, you explained all very simply and clearly. You make cool videos. Good luck

  • @scottsaccenti
    @scottsaccenti 4 года назад +3

    Really good, clear and to the point

  • @ta9sas
    @ta9sas 3 года назад +1

    Quick and well explained, thank you colby

  • @andreafreeman6396
    @andreafreeman6396 3 года назад +2

    Amazing tutorial!! Thank you for explaining everything so clearly

  • @dermotboyle9968
    @dermotboyle9968 4 года назад

    Super good Colby, loved how you did the cuts to keep it concise, thanks ! :)

  • @emyboybeats4330
    @emyboybeats4330 4 года назад +2

    Nice tutorial, Straight to the point.

  • @francoaccifonte2395
    @francoaccifonte2395 3 года назад

    incredible video, I love how short it was. Imma go try it right now, cheers!

  • @kevklash
    @kevklash Год назад

    The best example of this library ever. Thanks so much bro, you got a new subs!

  • @hafiedzmada
    @hafiedzmada Год назад

    thanks for the tutorial! your explanation are quick and clear! keep it up!

  • @shivambhatnagar9473
    @shivambhatnagar9473 Год назад

    Man you are a live saver. Thanks for this wonderful tutorial.

  • @hanzhiyin5239
    @hanzhiyin5239 Год назад

    Clear and concise! this tutorial is terrific!

  • @sergi3629
    @sergi3629 3 года назад +1

    This helped a lot, had it working in 10 mintues.

    • @colbyfayock
      @colbyfayock  3 года назад

      yay awesome! happy to hear that 🙌

  • @rimajlassi7183
    @rimajlassi7183 Год назад

    simple, fast and clear thank you !

  • @林-f4k
    @林-f4k 2 года назад

    This the best video to learn beautiful DND

    • @colbyfayock
      @colbyfayock  2 года назад

      super happy to hear that!🙌

  • @ravish-shankar
    @ravish-shankar 2 года назад

    my man, thanks for this, quick explanation.

  • @KGMarkets
    @KGMarkets 3 года назад +7

    you deserve more subscribers and likes

  • @dinizec
    @dinizec 3 года назад

    great tut, I wash every tutorial on youtube was this good

    • @colbyfayock
      @colbyfayock  3 года назад

      thanks for the kind words :) glad it was helpful!

  • @usmanasghar8779
    @usmanasghar8779 3 года назад +1

    good and concise than creator. excellent buddy..

  • @MistaT44
    @MistaT44 3 года назад +1

    Such a helpful and concise tutorial. Cheers bro! :)

  • @watchyoutb
    @watchyoutb 3 года назад +1

    thanks, concise and good to follow along, all makes sense!

  • @viveknigam3003
    @viveknigam3003 4 года назад +3

    Just what I needed! Thanks a lot for this video! 🤩

    • @colbyfayock
      @colbyfayock  4 года назад +1

      no problem. glad it helped! :D

  • @oscarmejia8306
    @oscarmejia8306 4 года назад

    Followed the example almost exactly the same and works on my app!

  • @PeeGaming
    @PeeGaming Год назад +2

    Is it possible to drag and drop multiple list items if so will you please do a tutorial on that? Thanks for the video :)

    • @peeyushchaturvedi798
      @peeyushchaturvedi798 Год назад

      I would love to know about Multi drag and its implementation as well.

  • @13thlwvemike95
    @13thlwvemike95 3 года назад +2

    Maaan. if all tutorials could be like this ....

  • @Hennadiii
    @Hennadiii 4 года назад +1

    That's great! Short and what's needed!

  • @godswillumukoro8908
    @godswillumukoro8908 3 года назад +2

    Thanks Colby, got a quick question.
    How to save the position of draggable component after refreshing page

    • @colbyfayock
      @colbyfayock  3 года назад

      no problem! you have a few options, it mostly depends on if you want this to save locally in the browser session or if you want to save it remotely. if you want to save it locally, you can use localstorage and sync the state. otherwise you can save it in a database

    • @godswillumukoro8908
      @godswillumukoro8908 3 года назад

      @@colbyfayock Thank you.

  • @EnesKab
    @EnesKab 3 года назад +1

    Highly appreciated. Thank you !

  • @albarmoerhamsa4189
    @albarmoerhamsa4189 4 года назад +1

    Thanks bro, that was pretty cool and easy to learn

    • @colbyfayock
      @colbyfayock  4 года назад

      thanks, glad you enjoyed it!

  • @amlanmishra6273
    @amlanmishra6273 3 года назад

    i love your code ! Its so clear and simple to understand ! thanks mate ^_^

  • @Frest99
    @Frest99 3 года назад +1

    Thank you man, super simple explanation

    • @colbyfayock
      @colbyfayock  3 года назад +1

      no problem, glad it was helpful!

  • @Atif1702
    @Atif1702 3 года назад

    My coding life is much easier since I found you. You rock, man ;)

    • @colbyfayock
      @colbyfayock  3 года назад +1

      thanks :) glad it helped!

    • @Atif1702
      @Atif1702 3 года назад

      @@colbyfayock Have you used Fluent UI with NextJS? It is having issues with NextJS

    • @colbyfayock
      @colbyfayock  3 года назад

      @@Atif1702 cant say ive ever tried that

    • @Atif1702
      @Atif1702 3 года назад

      @@colbyfayock Oh np 😉

  • @dramastar30
    @dramastar30 3 года назад +1

    This was cool and on point. Thanks man for creating this tutorial 👍🏻

  • @waliullahkhan6862
    @waliullahkhan6862 2 года назад

    Just Amazing sir, I first time tried and got it a success ... Thank you for your outstanding work.

    • @colbyfayock
      @colbyfayock  2 года назад

      And thanks for the nice words! Glad to hear it helped

  • @eldersonlaborit2290
    @eldersonlaborit2290 4 года назад +1

    Awesome dude, this was what i looking for.

    • @colbyfayock
      @colbyfayock  4 года назад

      thanks Enderson! glad it helped

  • @hudd1n366
    @hudd1n366 Год назад +1

    Terimakasih, penjelasan anda sangat baik dan singkat 👍👍

  • @talhaboyraz
    @talhaboyraz 3 года назад

    Thank you so much Colby. Excellent tutorial .

  • @ysarsenekuo5498
    @ysarsenekuo5498 4 года назад +1

    Thanks for sharing. This is really helpful!

    • @colbyfayock
      @colbyfayock  4 года назад

      no problem, glad to hear! :)

  • @imlava5464
    @imlava5464 3 года назад +2

    Damn, it's really excellent, thank you so much :D

  • @brandonayala2507
    @brandonayala2507 2 года назад

    This was great i dread doing drag and drop feel like it's overly complicated for setup, but this helps Thanks

  • @amirhosseinsefati
    @amirhosseinsefati Год назад

    Wow, really helpful. Thanks for sharing your knowledge.

  • @shujathaliirfan2662
    @shujathaliirfan2662 3 года назад +2

    U are too good at it

  • @tranbao2799
    @tranbao2799 4 года назад +1

    Wish I found this earlier lol. This video is kinda easy to follow

    • @colbyfayock
      @colbyfayock  4 года назад

      glad to hear, hope it still helps :)

  • @VikNov
    @VikNov 2 года назад

    Great, thank you for not wasting too much of our time 😃👍

  • @sureshjavvadi2870
    @sureshjavvadi2870 8 месяцев назад +1

    Hy while using drag drop in horizontal scroll bar the items are not dropped beyond the initial width
    Initially i have 6 images showing in scroll bar, i am able to drag and drop in this 6 images but i unable to drop the items beyond the 7th image. help me

  • @bokar98
    @bokar98 3 года назад

    Fast and simple. Thanks!

  • @colbyfayock
    @colbyfayock  2 года назад +12

    Getting errors with React 18? Try disabling Strict Mode in development (h/t @knitest1ck)

    • @rodrigonovais9624
      @rodrigonovais9624 2 года назад +3

      Sadly Atlassian is not actively supporting the package anymore
      ALmost all React 18 related problems can be solved by switching over to "@hello-pangea/dnd"
      This branch has full support and it's up to date

    • @colbyfayock
      @colbyfayock  2 года назад +1

      @@rodrigonovais9624 interesting, thanks for the heads up!

    • @pensums
      @pensums 2 года назад

      It took so damn long for me to find that out lol.

    • @colbyfayock
      @colbyfayock  2 года назад

      @@pensums yeah it's an annoying one 😭

    • @adsonwesley7726
      @adsonwesley7726 2 года назад

      Thanks Colby

  • @whoisarjen6368
    @whoisarjen6368 3 года назад +1

    This was awesome, thank you!

  • @aryanchatterjee8659
    @aryanchatterjee8659 2 года назад

    Loved this video. Exactly what I needed.

  • @clairedochez3743
    @clairedochez3743 Год назад

    Thank you for this amazing tutorial!

  • @jimchapman4579
    @jimchapman4579 Год назад

    Great video! Helped a lot! Thanks!

  • @Porcarito
    @Porcarito 3 года назад

    Nice video man, u save my day.. greetings from Argentina!!

  • @majd3641
    @majd3641 2 года назад

    very nice and simple tutorial, thank you.

  • @lrajoo11
    @lrajoo11 3 года назад

    amazing and so short! Love it

  • @dheerajkumartiwari5104
    @dheerajkumartiwari5104 Год назад

    Great video.
    I am having one problem. If the list is very big . How can I add automatic scrolling while dragging the item?

  • @davidtjones
    @davidtjones 2 года назад

    Thank you so much for this video! Great tutorial :)

  • @DailyMindfulMotivations
    @DailyMindfulMotivations Год назад

    Thus is heaven! What a great video! ❤

  • @hungryghost5589
    @hungryghost5589 4 года назад +1

    Awesome video, thanks!

  • @iShadowDragon
    @iShadowDragon 3 года назад

    Thanks man, this was really helpful

  • @blash1314
    @blash1314 3 года назад

    thanks man great tutorial for react newbie like me to easy catch up and hands on dnd

  • @nithinsamuel9995
    @nithinsamuel9995 4 года назад +1

    Thank you so much.. very nice explanation..subscribed

  • @ElChowDinamico
    @ElChowDinamico 3 года назад +2

    Hi! I'm getting an innerRef error, and I've narrowed it down to it beeing I'm creating the dragdropcontext inside a div down the chain of elements and I need to get the dom ref, I've been trying to gather information about this but I haven't been able to find any good solution.
    'provided.innerRef has not been provided with a HTMLElement.' this is my error
    and my code is basically the same as yours but the is inside of a div inside of a div
    I would really apreciate it if you could help me out, thanks! great vid

    • @colbyfayock
      @colbyfayock  3 года назад +1

      hey can you put together the example in a codesandbox so i can take a look? codesandbox.io/

    • @ElChowDinamico
      @ElChowDinamico 3 года назад

      @@colbyfayock Hey! sure, I've never used codesandbox before, hope I did it right, here you go:
      codesandbox.io/embed/affectionate-pond-cr7qp?fontsize=14&hidenavigation=1&theme=dark

    • @ElChowDinamico
      @ElChowDinamico 3 года назад +2

      @@colbyfayock I got it working! I'm so dumb... I didn't realize you needed to use (provided) => () and I was using {} instead -.-
      Thank you anyways! nice tutorial got it working perfectly now

    • @colbyfayock
      @colbyfayock  3 года назад +1

      ​@@ElChowDinamico ah haha I'm happy to have helped debug 😂but glad to hear you figured it out!

    • @yablablaable
      @yablablaable 3 года назад

      @@ElChowDinamico Thanks, was struggling with the exact same thing!

  • @MoathElmarmori
    @MoathElmarmori Год назад

    what a great tutorial, thank you very much.

  • @AshishKumar-bf4cc
    @AshishKumar-bf4cc 3 года назад +1

    Very helpful and easy to understand awesome! thanks, Bhai Hindi me.

    • @colbyfayock
      @colbyfayock  3 года назад

      no problem, glad to hear that! :)

  • @appstuff6565
    @appstuff6565 Год назад

    hey thanks for this Colby! I am working on a similar project, however, each specific user has their own arrangement, so how can i persist data of items for that specfic user and its item arrangement?
    Im using supabase to fetch the items. and normal map function to display. The issue is in its persisting.

  • @raihan7422
    @raihan7422 2 года назад

    thanks bro, this is really help me alot

  • @alfacuber
    @alfacuber 4 года назад +2

    Hi, great tuturial! If I have two arrays, how can I drag items between them? I have two groups which can be mixed

    • @colbyfayock
      @colbyfayock  4 года назад +1

      hey Eyal, have you checked out this example from their docs by chance? react-beautiful-dnd.netlify.app/?path=/story/board--simple
      here's the source code: github.com/atlassian/react-beautiful-dnd/blob/master/stories/src/board/board.jsx
      i think the gist is having a Droppable that wraps both containers and using React state to manage the locations

    • @alfacuber
      @alfacuber 4 года назад +1

      @@colbyfayock Thanks!