Drag and Drop in React (Complete Tutorial)

Поделиться
HTML-код
  • Опубликовано: 17 дек 2024

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

  • @edward-vonschondorf-dev
    @edward-vonschondorf-dev Месяц назад +1

    Perfect timing, will try to use this on my next project!

  • @alexandroarauco8097
    @alexandroarauco8097 20 дней назад

    simple and efficient sample to understand drag and drop.
    Thanks.

  • @tomasburian6550
    @tomasburian6550 Месяц назад

    Thank you for using TS in your tutorials. You's the best!

  • @abdulhamidusman9197
    @abdulhamidusman9197 14 дней назад

    I wished i saw this earlier.
    Great video, Bro

  • @imvikasjangir
    @imvikasjangir 22 дня назад

    Thanks a lot for making it easier, and I'm gonna subscribe your channel for future updates🙌🏻

  • @kartikbh1474
    @kartikbh1474 14 дней назад

    Thank you so much brother.

  • @golden7877
    @golden7877 Месяц назад

    Needed this one a lot thank you so much.

  • @DaoPVT
    @DaoPVT Месяц назад

    nice tutorial, thank youuu 💯

  • @beodan9219
    @beodan9219 Месяц назад

    Very helpful, drag-drop become more easy

  • @kamyarkamali7685
    @kamyarkamali7685 Месяц назад

    you are the best bro

  • @oussamaayadi5936
    @oussamaayadi5936 Месяц назад +1

    Thank you. I have a question is there is any way to drag and drop in middle of elements?

  • @MadCreatorsAnuj
    @MadCreatorsAnuj 27 дней назад

    Can you please make a tutorial on the template builder in react js, for which we want nested drag and drop like container inside container

  • @euuNeguinho
    @euuNeguinho Месяц назад

    Great content, the Brazilian thanks you

  • @sunidhichouhan5948
    @sunidhichouhan5948 25 дней назад +1

    Can you please share a tutorial with grid layout, i need it in my project. currently, what you showed it is between columns. I want that the item can be placed freely and there is a single array. Displayed in flex direction row, can someone help me here??. I will be really grateful.

    • @igor49134
      @igor49134 7 дней назад

      Same in my case, actually working on a grid layout now and it DnD in the grid. Hopefully, we can get this 🙂

  • @igor49134
    @igor49134 7 дней назад

    RUclips literally doesn't have a tutorial that would check both rows and columns. I tried with your tutorial today, but it doesn't seems to address this challenge.
    Would it be possible to create such? Thank you in advance!

  • @PeterStJ
    @PeterStJ 23 дня назад

    Thank you for your effort. I am wondering how come all demos on the DNDKit website the 'drop' is animated, but your is not at all, it just renders on the new place without any interpolation? Is this because of tailwind?

    • @PeterStJ
      @PeterStJ 23 дня назад

      Oh, sorry, I figured it out, it requires transition for the transform to work, unrelated to tailwind.

  • @nouarchami9007
    @nouarchami9007 28 дней назад

    thanks from Algeria so lelpful....

  • @Deus-lo-Vuilt
    @Deus-lo-Vuilt Месяц назад

    Thanks bro ❤

  • @vijaychapagain646
    @vijaychapagain646 Месяц назад

    how to do for nested array that can go to root element or to other element meaning
    (anywhere)

  • @immityaaa
    @immityaaa Месяц назад

    Nice❤

  • @Fam-m4i
    @Fam-m4i Месяц назад

    If map returns a new array, why do you need to use callback in setState?

  • @ptolemyhenson6838
    @ptolemyhenson6838 Месяц назад +2

    How do you maintain order between elements?

    • @spacey6960
      @spacey6960 Месяц назад +1

      Its an array of objects that gets mapped and filtered over. Map filter are sequential from first to last, so theres nothing that could change the order, so the order of the tasks gets preserved.

    • @harsh_g2543
      @harsh_g2543 Месяц назад

      @@spacey6960 "Map filter are sequential from first to last" i am getting it maintains columns (todo progress and done) but how it is maintaining rows ?

    • @spacey6960
      @spacey6960 Месяц назад

      @@harsh_g2543 the only separation of items into columns is a column id field in every object, so columns dont actually exist as far as the data in the array is aware. It is not a matrix of elements, just an array of elements.
      Suppose the original order of items in the array. When a card moves from a column to another, a new object is being created in its place in the array, with all fields equal to the original except the column id. So if item1 was placed before item2 in the array, the new object item3 that has item1's contents and a modified column id will also be before item2 in the array. So moving an item from column to column doesnt change the order, just the column id field in the objects.
      To split items into columns, you always go from first to last and filter elements by their column id. Since item3 replaced item1, and item1 was before item2, that means item3 is before item2. This means item3 will be filtered before item2. Which means that if item3 and item2 are in the same column, item3 will always be ahead of item2.
      Moving items into another column doesnt change the order. Splitting the array into columns doesnt change the order. That means there is no reason why cards would change their order.

  • @srkuleo
    @srkuleo Месяц назад

    Isn't dnd-kit not maintained anymore? I am sure I've read somewhere that original creator stopped maintaining it or rather is not updating it, so in the future some APIs might not work.

  • @akoladebode-ajayi327
    @akoladebode-ajayi327 Месяц назад

    Thanks sir

  • @SaiponathGames
    @SaiponathGames Месяц назад

    Will this work for react native as well?

  • @awais_ansarii
    @awais_ansarii 24 дня назад

  • @codeinspector
    @codeinspector Месяц назад

    killer

  • @swapnilkatiyar8927
    @swapnilkatiyar8927 Месяц назад

    Wow,

  • @irfansaeedkhan7242
    @irfansaeedkhan7242 Месяц назад

    niceeee