You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Android] A RectButton with Reanimated enabled and a worklet callback ends the app at its first touch #4628
A RectButton with disableReanimated={false} and a worklet callback, such as onTouchesDown, ends the app at its first touch:
com.facebook.jni.CppException: [Worklets] Tried to synchronously call a Remote Function. Called "anonymous" on the UI Runtime.
at runCallback_eventHandlersUtilsTs3
at handleStateChangeEvent_eventHandlerTs1
A worklet callback puts the gesture on the Reanimated detector (configUtils.ts#L80-L84), which runs its callbacks on the UI runtime, and BaseButton, which RectButton renders, hands RawButton its own onBegin, onActivate, onDeactivate and onFinalize, none of them worklets (GestureButtons.tsx#L57-L109). A RawButton with a worklet callback, and a RectButton with disableReanimated={false} and no worklet callback, work.
Steps to reproduce
Render the component from the gist.
Tap the first button, a RawButton with a worklet onTouchesDown: it logs.
Tap the second, a RectButton with only onPress: it logs.
Tap the third, a RectButton with a worklet onTouchesDown: the app ends with the error above.
A link to a Gist, an Expo Snack or a link to a repository based on this template that reproduces the bug.
Activity