From 635732aa8fedc241d94eb1610dd58635f597b07d Mon Sep 17 00:00:00 2001 From: Edmond Chui Date: Wed, 7 Feb 2024 07:44:24 -0800 Subject: [PATCH] Fix order of Metro hotkey console messages (#42896) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/42896 Changelog: [General][Fixed] Fix order of Metro hotkey console messages # Existing Key handler is printing messages to the console _after_ it has been processed, this causes error messages to appear before the `info` message. # In this PR The `info` messages are logged before the event is processed. Reviewed By: GijsWeterings Differential Revision: D53479732 fbshipit-source-id: 25af47450662de4eb03d0dfd52af5af014ef3e49 --- .../src/commands/start/attachKeyHandlers.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/community-cli-plugin/src/commands/start/attachKeyHandlers.js b/packages/community-cli-plugin/src/commands/start/attachKeyHandlers.js index 06f7c3ec234945..1278832bc0f603 100644 --- a/packages/community-cli-plugin/src/commands/start/attachKeyHandlers.js +++ b/packages/community-cli-plugin/src/commands/start/attachKeyHandlers.js @@ -46,12 +46,12 @@ export default function attachKeyHandlers({ const onPress = async (key: string) => { switch (key) { case 'r': - messageSocket.broadcast('reload', null); logger.info('Reloading connected app(s)...'); + messageSocket.broadcast('reload', null); break; case 'd': - messageSocket.broadcast('devMenu', null); logger.info('Opening Dev Menu...'); + messageSocket.broadcast('devMenu', null); break; case 'i': logger.info('Opening app on iOS...');