Skip to content

Commit

Permalink
refactor: move _WORKLET injection to Worklets decorator (#6816)
Browse files Browse the repository at this point in the history
## Summary

`RNRuntimeWorkletDecorator` executes before `RNRuntimeDecorator`
already.

## Test plan

Works fine 👍
  • Loading branch information
tjzel authored Dec 12, 2024
1 parent 643f8ca commit 4ce84b2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ namespace reanimated {
void RNRuntimeDecorator::decorate(
jsi::Runtime &rnRuntime,
const std::shared_ptr<ReanimatedModuleProxy> &reanimatedModuleProxy) {
rnRuntime.global().setProperty(rnRuntime, "_WORKLET", false);

jsi::Runtime &uiRuntime = reanimatedModuleProxy->getUIRuntime();
auto workletRuntimeValue =
rnRuntime.global()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ namespace worklets {
void RNRuntimeWorkletDecorator::decorate(
jsi::Runtime &rnRuntime,
const std::shared_ptr<WorkletsModuleProxy> &workletsModuleProxy) {
rnRuntime.global().setProperty(rnRuntime, "_WORKLET", false);

rnRuntime.global().setProperty(
rnRuntime,
"__workletsModuleProxy",
Expand Down

0 comments on commit 4ce84b2

Please sign in to comment.