Skip to content

Commit cb706f3

Browse files
committed
Add RCTDevMenuConfiguration to AppDelegate.mm and AppDelegate.swift
1 parent 56c7a32 commit cb706f3

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

packages/rn-tester/RNTester/AppDelegate.mm

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@
2929
#define USE_OSS_CODEGEN 0
3030
#endif
3131

32+
#if RCT_DEV_MENU
33+
#import <React/RCTDevMenu.h>
34+
#endif
35+
3236
static NSString *kBundlePath = @"js/RNTesterApp.ios";
3337

3438
@interface AppDelegate () <UNUserNotificationCenterDelegate>
@@ -43,6 +47,15 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
4347
self.dependencyProvider = [RCTAppDependencyProvider new];
4448
#endif
4549

50+
#if RCT_DEV_MENU
51+
52+
RCTDevMenuConfiguration *devMenuConfiguration = [[RCTDevMenuConfiguration alloc] initWithDevMenuEnabled:true
53+
shakeGestureEnabled:true
54+
keyboardShortcutsEnabled:true];
55+
[self.reactNativeFactory setDevMenuConfiguration:devMenuConfiguration];
56+
57+
#endif
58+
4659
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
4760

4861
[self.reactNativeFactory startReactNativeWithModuleName:@"RNTesterApp"

private/helloworld/ios/HelloWorld/AppDelegate.swift

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,16 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
2727

2828
reactNativeDelegate = delegate
2929
reactNativeFactory = factory
30+
31+
#if RCT_DEV_MENU
32+
let devMenuConfiguration = RCTDevMenuConfiguration(
33+
devMenuEnabled: true,
34+
shakeGestureEnabled: true,
35+
keyboardShortcutsEnabled: true
36+
)
37+
38+
reactNativeFactory?.devMenuConfiguration = devMenuConfiguration
39+
#endif
3040

3141
window = UIWindow(frame: UIScreen.main.bounds)
3242

0 commit comments

Comments
 (0)