Skip to content

Commit b93c24b

Browse files
authored
docs: update Worklets import forwarding setup (#22)
1 parent 55df195 commit b93c24b

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

README.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ yarn add react-native-enriched-markdown react-native-worklets remend
4747

4848
### 1. `babel.config.js` — configure Worklets Babel plugin
4949

50-
`react-native-streamdown` requires special options to be added to the Worklets Babel plugin config in `babel.config.js`, namely `bundleMode: true` and `workletizableModules: ['remend']`. Your final config could look like this:
50+
`react-native-streamdown` requires special options to be added to the Worklets Babel plugin config in `babel.config.js`, namely `bundleMode: true` and `importForwarding.moduleNames: ['remend']`. Your final config could look like this:
5151

5252
#### Expo
5353

@@ -63,7 +63,9 @@ module.exports = function (api) {
6363
{
6464
bundleMode: true,
6565
// other options...
66-
workletizableModules: ['remend'], // add this line
66+
importForwarding: {
67+
moduleNames: ['remend'], // add this line
68+
},
6769
},
6870
],
6971
],
@@ -77,11 +79,15 @@ module.exports = function (api) {
7779
const workletsPluginOptions = {
7880
bundleMode: true,
7981
// other options...
80-
workletizableModules: ['remend'], // add this line
82+
importForwarding: {
83+
moduleNames: ['remend'], // add this line
84+
},
8185
};
8286
```
8387

84-
`workletizableModules: ['remend']` tells the Babel plugin to pre-bundle `remend` for the worklet runtime so it can be called off the JS thread.
88+
`importForwarding.moduleNames: ['remend']` tells the Babel plugin to forward the `remend` import into the generated worklet so it can be called off the JS thread.
89+
90+
For `react-native-worklets` versions below 0.10, use `workletizableModules: ['remend']` instead.
8591

8692
### 2. `metro.config.js` — configure Metro for monorepos
8793

0 commit comments

Comments
 (0)