From c93308756778c0593aaa56e2e79624f34f748df2 Mon Sep 17 00:00:00 2001 From: Tj Date: Fri, 7 Aug 2015 04:36:10 -0700 Subject: [PATCH] CMD+R should post a refresh notification. Summary: For the sake of consistency, `cmd+r` should just post a refresh notification. This way other tools can also observe and react to the refresh without ugly hacks. Closes https://github.com/facebook/react-native/pull/2175 Github Author: Tj --- React/Base/RCTBridge.m | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/React/Base/RCTBridge.m b/React/Base/RCTBridge.m index c126e8565..09523d2fb 100644 --- a/React/Base/RCTBridge.m +++ b/React/Base/RCTBridge.m @@ -199,14 +199,16 @@ RCT_NOT_IMPLEMENTED(-init) #if TARGET_IPHONE_SIMULATOR - __weak RCTBridge *weakSelf = self; RCTKeyCommands *commands = [RCTKeyCommands sharedInstance]; // reload in current mode [commands registerKeyCommandWithInput:@"r" modifierFlags:UIKeyModifierCommand - action:^(__unused UIKeyCommand *command) { - [weakSelf reload]; + action:^(__unused UIKeyCommand *command) + { + [[NSNotificationCenter defaultCenter] postNotificationName:RCTReloadNotification + object:nil + userInfo:nil]; }]; #endif