Open amannn opened 9 years ago
Yup coming up! @chenglou's fixing some important thingy inside the API so we're waiting on those before adding features.
It'll probably a prop like currVelocity={currVelocity => ...}
Great, thanks for the quick response!
I'm actually working on a photo gallery while exploring touch gestures and velocity. I'll ping you as soon as I get a gist up in the next couple of days.
Cool, thanks!
Btw. for inspiration for physics based animations the examples from Ralph Thomas are also very nice: http://iamralpht.github.io/constraints/ and http://iamralpht.github.io/physics/. If these can be rebuilt with react-motion then I don't know what else there could be in this lib. But he is actually lacking some features that react-motion is capable of, such as setting an end value.
Haha, I've talked to him, definitely knows what he's doing. Hey @iamralpht, check out this new repo =).
My goal is to get as declarative as the constraint stuff, which I really appreciate. Unfortunately JS isn't expressive enough, and most people will be scared away by the constraint API so as a pragmatic reason I'll hold off. Now, if you could somehow express these constraints naturally using react's component hierarchy, I'm immediately deprecating this repo.
(Kidding, react-motion's awesome so far, but still.)
Any news on this? :)
Not yet; hopefully soon.
I'd love to see some way to do this too, just being able to set current state and velocity would cover my use case - I tried with setState but I'm guessing #88 prevents this working.
I assume this has fallen off the map, but just as food for thought: what might this API look like? Is there any way to provide force/impulse in a declarative way?
Is there a a good way to apply forces to a system? A use case is when you drag an element on a touch device and release it with a specific velocity. You want the element to being thrown into that direction.
Additionally an element could have another force that is being applied on it, so that it will eventually move to a specific end position.
Compare for example the photo gallery of the react-touch demo of Pete Hunt. When you flick with a higher velocity, multiple photos can be navigated at once.
Is there a recommended way for doing this with react-motion?