In a real app
The rule to remember: a worklet only sees what it captured when it was created, and can only call other worklets or native functions exposed to the UI runtime. Calling an ordinary function (a setState, a navigation, a network call) from a worklet throws; you go through scheduleOnRN(fn, ...args) from react-native-worklets, which schedules the call on the JS thread (Reanimated 3’s runOnJS). The other way around, scheduleOnUI replaces runOnUI to run a worklet from the JS thread.
Typical pitfalls: a closure capturing a large object (the whole data list, say), copied into the UI runtime on every creation; a utility function imported from a file without the worklet directive, failing on first call; console.log output that seems out of order because it comes from two runtimes. The “Tried to synchronously call a non-worklet function on the UI thread” message names exactly that situation.
To confirm the plugin is active, a working useAnimatedStyle is enough; if it fails with a worklet error, it is usually babel.config.js (plugin missing or misplaced) or a Metro cache to clear. Worklets also serve outside animation, for instance to process camera frames with VisionCamera, which exposes its own worklet runtime.
Related terms
Reanimated
Software Mansion’s animation library that runs animations on the UI thread through worklets, without waiting on the JavaScript thread.
Gesture Handler
Software Mansion’s library that recognizes gestures (pan, tap, pinch, and more) natively and composes them, with callbacks on the UI thread.
JSI (JavaScript Interface)
The C++ API that lets JavaScript hold direct references to native objects with no serialization: the foundation of the New Architecture.
Hermes
Meta’s JavaScript engine for React Native, the default since 0.70, which precompiles the bundle to bytecode at build time.