Skip to content

Commit

Permalink
Fix dev tool hotkets in RNTester
Browse files Browse the repository at this point in the history
Summary:
This diff fixed hotkeys for dev tools like cmd+d, cmd+r, and cmd+i when Turbo Modules are enabled until we have a proper way to eagerly initialize turbo modules.

Changelog: [Internal]

Reviewed By: RSNara

Differential Revision: D21517482

fbshipit-source-id: 8c68bc126361aa961a4f05c93dc19ada32fe44c7
  • Loading branch information
rickhanlonii authored and facebook-github-bot committed May 14, 2020
1 parent 0199a03 commit c3a3d42
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions RNTester/RNTester/AppDelegate.mm
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,15 @@ - (void)loadSourceForBridge:(RCTBridge *)bridge
_turboModuleManager = [[RCTTurboModuleManager alloc] initWithBridge:bridge
delegate:self
jsInvoker:bridge.jsCallInvoker];

#if RCT_DEV
/**
* Eagerly initialize RCTDevMenu so CMD + d, CMD + i, and CMD + r work.
* This is a stop gap until we have a system to eagerly init Turbo Modules.
*/
[_turboModuleManager moduleForName:"RCTDevMenu"];
#endif

__weak __typeof(self) weakSelf = self;
return std::make_unique<facebook::react::JSCExecutorFactory>([weakSelf, bridge](facebook::jsi::Runtime &runtime) {
if (!bridge) {
Expand Down

0 comments on commit c3a3d42

Please sign in to comment.