Skip to content

Commit be098c2

Browse files
authored
Fixed missing feature flags (#8066)
1 parent c6a033c commit be098c2

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

lib/ios/RNNAppDelegate.mm

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11

22
#import "RNNAppDelegate.h"
33
#import <ReactNativeNavigation/ReactNativeNavigation.h>
4+
#import <react/featureflags/ReactNativeFeatureFlags.h>
5+
#import <react/featureflags/ReactNativeFeatureFlagsDefaults.h>
46

57

68
#import "RCTAppSetupUtils.h"
@@ -31,6 +33,8 @@ @implementation RNNAppDelegate
3133
- (BOOL)application:(UIApplication *)application
3234
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
3335

36+
[self _setUpFeatureFlags];
37+
3438
// Copied from RCTAppDelegate, it private inside it
3539
self.rootViewFactory = [self createRCTRootViewFactory];
3640

@@ -94,4 +98,38 @@ - (BOOL)concurrentRootEnabled {
9498
return true;
9599
}
96100

101+
#pragma mark - Feature Flags
102+
103+
class RCTAppDelegateBridgelessFeatureFlags : public facebook::react::ReactNativeFeatureFlagsDefaults {
104+
public:
105+
bool enableBridgelessArchitecture() override
106+
{
107+
return true;
108+
}
109+
bool enableFabricRenderer() override
110+
{
111+
return true;
112+
}
113+
bool useTurboModules() override
114+
{
115+
return true;
116+
}
117+
bool useNativeViewConfigsInBridgelessMode() override
118+
{
119+
return true;
120+
}
121+
bool enableFixForViewCommandRace() override
122+
{
123+
return true;
124+
}
125+
};
126+
127+
- (void)_setUpFeatureFlags
128+
{
129+
if ([self bridgelessEnabled]) {
130+
facebook::react::ReactNativeFeatureFlags::override(std::make_unique<RCTAppDelegateBridgelessFeatureFlags>());
131+
}
132+
}
133+
97134
@end
135+

0 commit comments

Comments
 (0)