Worklets on the web - am I missing something? #3694
Replies: 2 comments
-
Hey, the
Link to docs: https://docs.swmansion.com/react-native-reanimated/docs/guides/worklets/#using-worklets-on-the-web |
Beta Was this translation helpful? Give feedback.
-
Thanks for the help! I am explicitly passing dependency arrays wherever necessary per the Web without the Babel plugin guide. I'm not using Babel, so I can't use the plugin. If that's all the directive is necessary for then it sounds like I'm set. Does react-native-reanimated surface a way to suppress the warning on the web? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
My understanding is that worklets don't apply to the web, which is a single-threaded environment (web workers aside, which worklets do not use). However react-native-gesture-handler is throwing many, many console warnings in the web version of my app:
I'm struggling to understand why react-native-gesture-handler would throw this warning on a platform where worklets aren't supported.
I'm using react-native-gesture-handler@2.25.0 with react-native-reanimated@3.19.1 on both react-native and the web. I have the react-native-reanimated babel plugin installed on native. Native works correctly. I am not using the plugin on the web because I'm not using babel. I've followed the instructions to get react-native-reanimated working without the plugin. Web works correctly as well, but react-native-gesture-handler is throwing all of these warnings.
I'm not sure if I'm doing something wrong or, if not, how I can suppress the warnings on the web. I don't really want to add
.runOnJS(true)
as I'd have to fork my code between native and web to avoid tanking native animations.Thanks!
Beta Was this translation helpful? Give feedback.
All reactions