Skip to main content
Version: Unreleased

Threading

Run work on another runtime, return a result, or create a worker for background calculations. Start with Running worklets on the UI runtime to compare asynchronous and synchronous calls. See Call tables for which runtimes can call each API.

Run on the UI Runtime​

  • scheduleOnUI — Schedule work without waiting for a result.
  • runOnUIAsync — Run work asynchronously and await its result.
  • runOnUISync — Run work synchronously on the calling thread, blocking until the result is ready.
  • UIRuntimeId — Identify the UI Runtime when an API takes a runtime ID.

Run on a Worker Runtime​

Return to the RN Runtime​

  • scheduleOnRN — Schedule a function on the React Native runtime, for example to update React state.

Address a runtime by ID​

Use these variants when you have a runtime ID instead of a WorkletRuntime object.

Deprecated APIs​

For new code, use the replacements linked from these reference pages.