In this video, we dive into the fundamentals of drag-and-drop interactions within React applications, using the Pragmatic Drag-and-Drop (pdnd) library. We'll start by building a simple board application and explore key features like draggable components, handling drag events, and managing states. Learn how to create a custom drag preview UI to improve user experience.
*Timeline:*
01:26 - Introduce Pragmatic Drag-and-Drop
04:58 - Introduce the board application
08:22 - The draggable
12:48 - Dragging events
14:30 - Working with states
16:15 - Dragging preview
18:33 - Customise preview UI
22:13 - Wrapping up
This is just the beginning—upcoming videos will dive deeper into drop operations, adding more complex interactions when dragging cards between columns, and covering all the core features of a complete drag-and-drop system in React.
Subscribe to my newsletter for more articles and videos on refactoring and clean code tips: https://juntao.substack.com/
Additional Resources:
React Anti-Patterns: https://www.amazon.com/React-Anti-Pat...
React Clean Code Book: https://leanpub.com/react-clean-code
Maintainable React Book: https://leanpub.com/maintainable-react
Mastering Maintainable React Course: https://www.udemy.com/course/masterin...
Headless Component Pattern: https://www.martinfowler.com/articles...
Don't just write code—write clean, maintainable code that stands the test of time. Let's refactor together!