Amazon Developer

as

Settings
Sign out
Notifications
Alexa
Amazon Appstore
Ring
AWS
Documentation
Support
Contact Us
My Cases
Get Started
Design and Develop
Publish
Reference
Support
Skip to main content
@amazon-devices/react-native-worklets is the React Native multithreading library that provides the foundation for Reanimated’s performance capabilities. It allows you to run JavaScript code in parallel on multiple threads and runtimes, enabling smooth animations and interactions that don’t block the main JavaScript thread.

What are Worklets?

Worklets are JavaScript functions that can be serialized and executed on different threads. When you mark a function with the 'worklet' directive, the Babel plugin transforms it into a serializable format that can be copied and run on the UI thread or other custom runtimes.

Key Features

  • Multithreading: Execute JavaScript code on separate threads (UI thread, custom worklet runtimes)
  • Zero-copy serialization: Efficiently transfer functions between threads without performance overhead
  • Babel plugin integration: Automatically transforms marked functions into worklets
  • Runtime creation: Create custom JavaScript runtimes for specialized workloads
  • Seamless integration: Works transparently with Reanimated for animations and gestures

Documentation

Check out dedicated documentation page for info about this library, API reference and more: https://docs.swmansion.com/react-native-worklets/.

Installation

  1. Add the JavaScript library dependency in the package.json file.
  2. Add @amazon-devices/react-native-worklets/plugin plugin to your babel.config.js
  3. Clear Metro bundler cache using npm start -- --reset-cache command.
  4. Reinstall package-lock.json file using npm install command.
  5. If you’ll need more detailed info, you could refer to the installation section of the external docs.

Examples

Demonstrates creating and using custom worklet runtimes for parallel processing
Thread switching example

APIs

Worklets library on Vega provides comprehensive APIs for multithreading, memory management, and utility functions.

Threading

Memory

Utility

Exceptions on Vega

Worklets library on Vega has a few exceptions in terms of API support. This section will go over those exceptions.
  • Feature flags are currently not supported on Vega
  • Bundle Mode is currently not supported on Vega

Supported versions

Credits

This project has been built and is maintained thanks to the support from Shopify, Expo.io and Software Mansion
Last modified on July 13, 2026