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; }