Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Animated.event() with useNativeDriver returns an object, not a function #16250
Is this a bug report?
Have you read the Contributing Guidelines?
Packages: (wanted => installed)
Target Platform: iOS (11)
Steps to Reproduce
I just hit #13377 but with
Is this a bug or expected behaviour? If
This is expected behaviour, as the PanResponder doesn't support native animations yet, because it's implemented in pure JS - hence it can't generate native events, as it has to pass the JS to native bridge to update the animations (because it handles touches in JS). Furthermore it even has to pass the bridge twice and performs worse than standard JS thread animations (which already can be pretty laggy), due to the fact, that the touch also has to be passed to the JS side, making it like this:
Problem: The communication over the JS - native bridge is pretty expensive. You could try using something like https://github.com/wix/react-native-interactable (it says experimental, but in my experience it's quiet stable - don't quote me on that tho), which has native implementations with animations, callbacks and configurable physics so you can do quiet a lot with it.
Also see #13377
@DragonRaider5 Thanks for your reply, but I think this is still unexpected behaviour. My use case doesn't involve
Just to be totally clear: the bug I am reporting is that
Also: thanks for the
Amazing, that fixed it! Thanks so much. I had no idea I had to use an
I think maybe this should be highlighted in the docs? The docs currently say "Only animatable components can be animated", they don't mention that the source of
EDIT: I've just found a mention of using