Installation
Check the compatibility table to find the Worklets version that supports your React Native version.
Worklets 1.0 needs Metro 0.88.0 or newer and React Native 0.89 or newer, which together support inline modules.
Step 1: Install the package
Install react-native-worklets package from npm:
- NPM
- YARN
npm install react-native-worklets
yarn add react-native-worklets
Step 2: Configure your project
The remaining steps depend on how you build your app — pick your framework:
- Expo
- React Native Community CLI
Run prebuild to update the native code in the ios and android directories.
- NPM
- YARN
npx expo prebuild
yarn expo prebuild
And that's it! The Worklets library is now configured in your Expo project.


Don't I need the Worklet Syntax Babel plugin?
Since Expo SDK 54, the Expo starter template includes the Worklet Syntax Babel plugin by default, so there's nothing to add. On older SDKs, add react-native-worklets/plugin to your babel.config.js as described in the React Native Community CLI tab.
To learn more about the plugin go to Worklet Syntax plugin section.
Configure Metro
Worklets run in Bundle Mode, which needs a Metro configuration. Follow the Metro steps of the Bundle Mode setup before you start the app.
Clear Metro bundler cache (recommended)
- NPM
- YARN
npx expo start --clear
yarn expo start --clear
When using React Native Community CLI, you need to manually add the react-native-worklets/plugin plugin to your babel.config.js.
module.exports = {
presets: [
... // don't add it here :)
],
plugins: [
...
'react-native-worklets/plugin',
],
};
The Worklet Syntax Babel plugin comes with several options, you can explore what they are and how to use them in the Options for Worklet Syntax Babel plugin section.


Why do I need this?
In short, the Worklet Syntax plugin automatically converts special JavaScript functions (called worklet functions) to allow them to be passed and run on the Worklet Runtimes
To learn more about the plugin go to Worklet Syntax plugin section.
Configure Metro
Worklets run in Bundle Mode, which needs a Metro configuration. Follow the Metro steps of the Bundle Mode setup before you start the app.
iOS
While developing for iOS, make sure to install pods first before running the app:
cd ios && pod install && cd ..
Clear Metro bundler cache (recommended)
- NPM
- YARN
npm start -- --reset-cache
yarn start --reset-cache
Step 3: Patch metro-runtime for Fast Refresh
Fast Refresh on Worklet Runtimes uses HMRClient.addModuleUpdateListener from metro-runtime. This API is proposed in react/metro#2312 and no Metro release has it yet. Until one does, apply the patch below to metro-runtime 0.88, for example with yarn patch metro-runtime or patch-package. It adds the API to src/modules/HMRClient.js. Without the patch, a worklet function that Fast Refresh changes fails on Worklet Runtimes until you reload the app.
diff --git a/src/modules/HMRClient.js b/src/modules/HMRClient.js
--- a/src/modules/HMRClient.js
+++ b/src/modules/HMRClient.js
@@ -2,7 +2,18 @@
const EventEmitter = require("./vendor/eventemitter3");
const HEARTBEAT_INTERVAL_MS = 20_000;
+const moduleUpdateListeners = new Set();
const inject = ({ module: [id, code], sourceURL }) => {
+ Array.from(moduleUpdateListeners).forEach(({ listener }) => {
+ try {
+ listener(code, sourceURL);
+ } catch (error) {
+ console.error(
+ `Error while calling a module update listener for module ${id}: `,
+ error,
+ );
+ }
+ });
if (global.globalEvalWithSourceUrl) {
global.globalEvalWithSourceUrl(code, sourceURL);
} else {
@@ -14,6 +25,15 @@
update.modified.forEach(inject);
};
class HMRClient extends EventEmitter {
+ static addModuleUpdateListener(listener) {
+ const entry = { listener };
+ moduleUpdateListeners.add(entry);
+ return {
+ remove: () => {
+ moduleUpdateListeners.delete(entry);
+ },
+ };
+ }
_isEnabled = false;
_pendingUpdate = null;
_queue = [];