Add a flag to warn whenever the legacy NativeModule system is used

Summary:
When true, this flag will cause React Native to start logging soft exceptions, whenever the legacy NativeModule system is used. This flag is independent of useTurboModules. In practice, it's only enabled when TurboModules is enabled.

Changelog: [Internal]

Reviewed By: JoshuaGross

Differential Revision: D30250363

fbshipit-source-id: f610567c5b99a4fbf8252c3962908668f483d028
This commit is contained in:
Ramanpreet Nara
2021-08-13 13:53:44 -07:00
committed by Facebook GitHub Bot
parent f6d0f9deac
commit 2b427f8692
@@ -25,6 +25,13 @@ public class ReactFeatureFlags {
*/
public static volatile boolean useTurboModules = false;
/**
* After TurboModules and Fabric are enabled, we need to ensure that the legacy NativeModule isn't
* isn't used. So, turn this flag on to trigger warnings whenever the legacy NativeModule system
* is used.
*/
public static volatile boolean warnOnLegacyNativeModuleSystemUse = false;
/** Should we dispatch TurboModule methods with promise returns to the NativeModules thread? */
public static volatile boolean enableTurboModulePromiseAsyncDispatch = false;