Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trigger render when Animated.Event stream pauses #44447

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

j-piasecki
Copy link
Contributor

Summary:

This PR is doing essentially the same thing as #37836, but for animated events instead of the animations.

The two kind of sketchy things I did are:

  • To have access to the value of native Animated.Value I needed to add a no-op listener to it.
  • In order to avoid re-renders on every frame, which defeats the purpose of using the native driver, I arbitrarily chose to delay the render by 64 milliseconds on every event. This seems to work okay, but I'm not sure if it's the best solution.

Fixes #36504

Changelog:

[GENERAL] [FIXED] - When a stream of Animated.Event pauses, trigger re-render to update Pressability responder regions

Test Plan:

Tested on the reproducer from the issue

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Software Mansion Partner: Software Mansion Partner labels May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Software Mansion Partner: Software Mansion Partner
Projects
None yet
Development

Successfully merging this pull request may close these issues.

onPress is not called after using useNativeDriver transform button
2 participants