-
I want to scroll an element along the const [style, api] = useSpring(() => ({
x: 0,
y: 0,
scale: 1,
rotateZ: 0
}));
const bind = useGesture(
{
onWheel: (state) => {
let {
lastOffset: [ox, oy],
movement: [mx, my],
distance: [dix, diy],
direction: [dx, dy],
offset: [x, y],
} = state;
api.start({ x, y })
}) |
Beta Was this translation helpful? Give feedback.
Answered by
dbismut
Sep 4, 2023
Replies: 1 comment 3 replies
-
If you want help, you need to explain the problem in much much more details. Open source is not a hotline. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Why don't you use
start({ x: -x, y: -y })
?