-
How do I set an offset, or movement, for each spring created with |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
The lib only stores one state. But you can use the So you could do something like: const bind = useDrag(({ offset }) => {
// logic with offset
}, { from: ({ args: [index] }) => [springs[index].x.get(), springs[index].y.get()] }
return <>
{ springs.map((style, index) => (<div ref={index} {...bind(index)} />)
</> This is just pseudo code but do you get the idea? |
Beta Was this translation helpful? Give feedback.
The lib only stores one state. But you can use the
from
option.So you could do something like:
This is just pseudo code but do you get the idea?