Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: worklets on the Web are just JavaScript functions #6737

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
kacperkapusciak marked this conversation as resolved.
Show resolved Hide resolved
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.
kacperkapusciak marked this conversation as resolved.
Show resolved Hide resolved

## Platform compatibility

<PlatformCompatibility android ios web />
Loading