From 91d2b6ef0189797dfc8f1dc6a89bc26fb2911b78 Mon Sep 17 00:00:00 2001 From: Saikat Guha Date: Thu, 1 Oct 2020 19:46:50 +0530 Subject: [PATCH] DevTools: Remove ReactJS.org version check "cheat" (#19939) Remove dead code as facebook.github.io/react always redirects to reactjs.org, which has prod version of react. so removing the "cheat" (#19939) --- .../react-devtools-extensions/src/background.js | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/packages/react-devtools-extensions/src/background.js b/packages/react-devtools-extensions/src/background.js index 389ca1310a910..1a8302c2b1dfd 100644 --- a/packages/react-devtools-extensions/src/background.js +++ b/packages/react-devtools-extensions/src/background.js @@ -98,18 +98,7 @@ chrome.runtime.onMessage.addListener((request, sender) => { // We use browserAction instead of pageAction because this lets us // display a custom default popup when React is *not* detected. // It is specified in the manifest. - let reactBuildType = request.reactBuildType; - if (sender.url.indexOf('facebook.github.io/react') !== -1) { - // Cheat: We use the development version on the website because - // it is better for interactive examples. However we're going - // to get misguided bug reports if the extension highlights it - // as using the dev version. We're just going to special case - // our own documentation and cheat. It is acceptable to use dev - // version of React in React docs, but not in any other case. - reactBuildType = 'production'; - } - - setIconAndPopup(reactBuildType, sender.tab.id); + setIconAndPopup(request.reactBuildType, sender.tab.id); } } });