Springs Preserve Input Velocity
When velocity matters, use springs to preserve input energy.
Incorrect (velocity ignored):
onDragEnd={(e, info) => {
animate(target, { x: 0 }, { duration: 0.3 });
}}Correct (velocity preserved):
onDragEnd={(e, info) => {
animate(target, { x: 0 }, {
type: "spring",
velocity: info.velocity.x,
});
}}