-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Calling worklets from within a worklet doesn't work #5576
Comments
Hi @mrousavy. Do you have |
Hey - no I did not. I wasn't aware that this was behind a feature flag - is there any reason this is not enabled by default? I can offer help testing in a production app to see if that breaks anything. |
I've noticed some issues when using Testing in production app would be greatly appreciated, thank you! |
I mean why would anyone use |
Yes, you cannot use classes there (Hermes pls), but they actually sometimes have a context with |
Description
Calling a nested worklet (on another runtime) from within an existing worklet does not work, because the nested worklet apparently doesn't compile properly.
This code breaks:
Because the inlined function is not properly converted to a Worklet by the babel plugin:
When I lift out the worklet function from the worklet itself, it also doesn't work (with the same error as above):
When calling
runOnRuntime
directly from the worklet incontext1
(so without therunAsync
roundtrip):...it completely crashes the app with this error:
Steps to reproduce
Snack or a link to a repository
https://github.com/mrousavy/react-native-reanimated/tree/repro/nested-worklets
Reanimated version
3.6.0
React Native version
0.73.1
Platforms
Android, iOS
JavaScript runtime
Hermes
Workflow
React Native
Architecture
Paper (Old Architecture)
Build type
Debug app & dev bundle
Device
iOS simulator
Device model
No response
Acknowledgements
Yes
The text was updated successfully, but these errors were encountered: