From 78b226c6ab9e498a39bcc3c92b1fe9f8fbc286e9 Mon Sep 17 00:00:00 2001 From: Phillip Pan Date: Mon, 16 Oct 2023 20:49:44 -0700 Subject: [PATCH] docs for unstable_enableSyncVoidMethods (#40779) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/40779 Changelog: [Internal] adding docs to unstable_enableSyncVoidMethods config related methods Reviewed By: mdvacca, cipolleschi Differential Revision: D50160367 fbshipit-source-id: 6fc825f7225f11909e0749c75d03b2ddadc3d5aa --- .../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 ee685a42215448..5608b6fdec9e5c 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; }