Skip to content

Conversation

@j-piasecki
Copy link
Member

Description

  • Add runOnJS modifier that makes callbacks of the event to be ran on the JS thread.
  • Modified GestureDetector to make use of this modifier and filter out unnecessary gestures when assigning them to the value read by the Reanimated hook. Gestures marked with runOnJS will now be registered for device events regardless of whether its callbacks are worklets or not.
  • Show error when trying to use gesture with only some of the callbacks marked as worklets without marking it with runOnJS.

Test plan

Tested on the Example app, mainly on modified Transformations example as it relies heavily on onChange callback which isn't auto-workletized yet.

@j-piasecki j-piasecki requested review from jgonet and tomekzaw February 2, 2022 11:23
@j-piasecki j-piasecki merged commit 7ce194f into software-mansion:main Feb 18, 2022
@j-piasecki j-piasecki deleted the jpiasecki/gesture-runonjs branch February 18, 2022 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants