subscribe

Drag and drop a div in react using hooks

In this video we look at how to drag and drop in react using the react-use-gesture and react-spring libraries. We take the introduction screen of create-react-app and add dragging to its components. We then add an overlay which can be dragged up and down to expose a background image behind it. We use the hooks: useDrag (from react-use-gesture) and useSpring (from react-spring).

Also check out my previous post about react-spring How to animate mount and unmount of a react component using react-spring

⚡️ Links: