Skip to content

Commit

Permalink
docs: worklets on the web are just JS functions
Browse files Browse the repository at this point in the history
  • Loading branch information
kacperkapusciak committed Nov 20, 2024
1 parent 6fad03e commit 270c2c0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/docs-reanimated/docs/guides/worklets.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -158,3 +158,5 @@ function App() {
Worklets can run in other runtimes than the one provided by Reanimated. For example [VisionCamera](https://github.com/mrousavy/react-native-vision-camera) and [LiveMarkdown](https://github.com/Expensify/react-native-live-markdown) create their own worklet runtimes.

You can create your own worklet runtimes with [`createWorkletRuntime`](/docs/threading/createWorkletRuntime) function.

There's no UI thread available on the Web platform. Because of that, when Reanimated runs in the browser, worklets are resolved to plain JavaScript functions and the `'worklet';` directive has no effect.
2 changes: 2 additions & 0 deletions packages/docs-reanimated/docs/threading/runOnUI.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ import RunOnUISrc from '!!raw-loader!@site/src/examples/RunOnUI';

- Make sure not to execute `runOnUI` on the UI thread as this will result in an error.

- On the Web, `runOnUI` immediately calls the function given as the argument. In browsers there's no UI thread available.

## Platform compatibility

<PlatformCompatibility android ios web />

0 comments on commit 270c2c0

Please sign in to comment.