diff --git a/change/react-native-windows-2020-04-21-09-35-21-devtoolsfix.json b/change/react-native-windows-2020-04-21-09-35-21-devtoolsfix.json new file mode 100644 index 00000000000..817ca55ac1f --- /dev/null +++ b/change/react-native-windows-2020-04-21-09-35-21-devtoolsfix.json @@ -0,0 +1,8 @@ +{ + "type": "prerelease", + "comment": "Fix devtools connection to match RN0.62", + "packageName": "react-native-windows", + "email": "acoates@microsoft.com", + "dependentChangeType": "patch", + "date": "2020-04-21T16:35:21.511Z" +} \ No newline at end of file diff --git a/vnext/Microsoft.ReactNative/Views/ReactRootControl.cpp b/vnext/Microsoft.ReactNative/Views/ReactRootControl.cpp index bd5a340f130..7b73c9bc060 100644 --- a/vnext/Microsoft.ReactNative/Views/ReactRootControl.cpp +++ b/vnext/Microsoft.ReactNative/Views/ReactRootControl.cpp @@ -564,6 +564,12 @@ void ReactRootControl::ShowDeveloperMenu() noexcept { auto xamlRootGrid{xamlRootView.as()}; xamlRootGrid.Children().Append(m_developerMenuRoot); } + + // Notify instance that dev menu is shown -- This is used to trigger a connection to dev tools + if (auto instance = m_weakReactInstance.GetStrongPtr()) { + query_cast(*instance).CallJsFunction( + "RCTNativeAppEventEmitter", "emit", folly::dynamic::array("RCTDevMenuShown")); + } } void ReactRootControl::DismissDeveloperMenu() noexcept {