filmov
tv
Drag and Drop in React with React Query and react-beautiful-dnd
![preview_player](https://i.ytimg.com/vi/HeNVPF_fRXI/maxresdefault.jpg)
Показать описание
Learn how to add drag and drop in React with React Query and react-beautiful-dnd. This drag and drop tutorial refactors a React Query todo list app with react-beautiful-dnd and shows how to persist the reordered list items after refreshing the app.
🚀 Become a full-stack web dev with Zero To Mastery Courses:
👇 Follow Me On Social Media:
Drag and Drop in React with React Query and react-beautiful-dnd
(00:00) Intro
(00:11) Welcome
(00:32) What We're Adding
(01:28) Starter Code
(02:43) Updating & Adding Dependencies
(05:02) json-server
(06:06) Starting the project
(07:31) Initial DnD imports
(08:45) DragDropContext
(09:57) Bracket Pair Colorization
(10:27) Droppable
(11:55) Parent section
(13:02) Assigning content
(13:39) Mapping todos
(14:30) Draggable
(18:03) Droppable placeholder
(18:46) React 18 Strict Mode issue & solution
(23:24) Creating intermediate state
(25:31) onDragEnd destination
(29:16) Persisting DnD order with useEffect & localStorage
(36:05) Update handleOnDragEnd
(37:20) handleDelete
(41:05) Testing CRUD Ops and refresh / reload
📚 Tutorial References:
📚 React 18 & react-beautiful-dnd solution resources:
Was this React Drag and Drop tutorial with React Query helpful? If so, please share. Let me know your thoughts in the comments.
#react #drag #drop
Комментарии