Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 5 additions & 15 deletions packages/react-native/React/Base/RCTUtils.mm
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,10 @@
BOOL RCTIsHomeAssetURL(NSURL *__nullable imageURL);

// Whether the New Architecture is enabled or not
static BOOL _newArchEnabled = false;
BOOL RCTIsNewArchEnabled(void)
{
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
NSNumber *rctNewArchEnabled = (NSNumber *)[[NSBundle mainBundle] objectForInfoDictionaryKey:@"RCTNewArchEnabled"];
_newArchEnabled = rctNewArchEnabled == nil || rctNewArchEnabled.boolValue;
});
return _newArchEnabled;
NSNumber *rctNewArchEnabled = (NSNumber *)[[NSBundle mainBundle] objectForInfoDictionaryKey:@"RCTNewArchEnabled"];
return rctNewArchEnabled == nil || rctNewArchEnabled.boolValue;
}
void RCTSetNewArchEnabled(BOOL enabled)
{
Expand All @@ -52,16 +47,11 @@ void RCTSetNewArchEnabled(BOOL enabled)
// whether the New Arch is enabled or not.
}

static BOOL _legacyWarningEnabled = true;
BOOL RCTAreLegacyLogsEnabled(void)
{
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
NSNumber *rctNewArchEnabled =
(NSNumber *)[[NSBundle mainBundle] objectForInfoDictionaryKey:@"RCTLegacyWarningsEnabled"];
_legacyWarningEnabled = rctNewArchEnabled.boolValue;
});
return _legacyWarningEnabled;
NSNumber *rctNewArchEnabled =
(NSNumber *)[[NSBundle mainBundle] objectForInfoDictionaryKey:@"RCTLegacyWarningsEnabled"];
return rctNewArchEnabled.boolValue;
}

static NSString *__nullable _RCTJSONStringifyNoRetry(id __nullable jsonObject, NSError **error)
Expand Down
Loading