From c74f26abf04aa311d77ffa37c582e022054c2908 Mon Sep 17 00:00:00 2001 From: Phillip Pan Date: Tue, 10 Oct 2023 22:52:13 -0700 Subject: [PATCH] docs for unstable_enableSyncVoidMethods Summary: Changelog: [Internal] adding docs to unstable_enableSyncVoidMethods config related methods Differential Revision: D50160367 --- .../java/com/facebook/react/config/ReactFeatureFlags.java | 4 ++++ .../internal/turbomodule/core/TurboModuleManagerDelegate.java | 1 + 2 files changed, 5 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/config/ReactFeatureFlags.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/config/ReactFeatureFlags.java index e7de36ee272534..dcc671955de3bf 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/config/ReactFeatureFlags.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/config/ReactFeatureFlags.java @@ -36,6 +36,10 @@ public class ReactFeatureFlags { */ public static volatile boolean unstable_useTurboModuleInteropForAllTurboModules = false; + /** + * By default, native module methods that return void run asynchronously. + * This flag will make execution of void methods in TurboModules stay on the JS thread. + */ public static volatile boolean unstable_enableTurboModuleSyncVoidMethods = false; /** diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/turbomodule/core/TurboModuleManagerDelegate.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/turbomodule/core/TurboModuleManagerDelegate.java index da493a14fd3397..53208dbe266aeb 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/turbomodule/core/TurboModuleManagerDelegate.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/turbomodule/core/TurboModuleManagerDelegate.java @@ -70,6 +70,7 @@ public boolean unstable_shouldRouteTurboModulesThroughLegacyModuleInterop() { return false; } + /* Can TurboModule methods that return void execute on the JS thread? */ public boolean unstable_enableSyncVoidMethods() { return false; }