Skip to content

Commit

Permalink
Use frame callbacks for things scheduled via runOnUI
Browse files Browse the repository at this point in the history
  • Loading branch information
kmagiera committed Nov 29, 2022
1 parent d7d8569 commit c8a77da
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Common/cpp/NativeModules/NativeReanimatedModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,11 +206,12 @@ void NativeReanimatedModule::scheduleOnUI(
shareableWorklet->valueType() == Shareable::WorkletType &&
"only worklets can be scheduled to run on UI");
auto uiRuntime = runtimeHelper->uiRuntime();
scheduler->scheduleOnUI([=] {
frameCallbacks.push_back([=](double timestamp) {
jsi::Runtime &rt = *uiRuntime;
auto workletValue = shareableWorklet->getJSValue(rt);
workletValue.asObject(rt).asFunction(rt).call(rt);
});
maybeRequestRender();
}

jsi::Value NativeReanimatedModule::makeSynchronizedDataHolder(
Expand Down

0 comments on commit c8a77da

Please sign in to comment.