From 8e3e128ad7488068971b656d05a39e8fe6e0b8f1 Mon Sep 17 00:00:00 2001 From: Jared Forsyth Date: Mon, 3 Aug 2015 14:25:25 -0700 Subject: [PATCH] add warning when you have both the official version and the beta --- shells/chrome/src/GlobalHook.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/shells/chrome/src/GlobalHook.js b/shells/chrome/src/GlobalHook.js index 93abadfd69..6bea5b71d2 100644 --- a/shells/chrome/src/GlobalHook.js +++ b/shells/chrome/src/GlobalHook.js @@ -15,13 +15,20 @@ var globalHook = require('../../../backend/GlobalHook.js'); +// TODO: remove for release +var checkForOld = ` +if (window.__REACT_DEVTOOLS_GLOBAL_HOOK__) { + console.error("REACT DEVTOOLS ERROR\\nYou need to disable the official version of React Devtools in order to use the beta."); +} +` + var js = ( - '(' + globalHook.toString() + '(window))' + ';(' + globalHook.toString() + '(window))' ); // This script runs before the element is created, so we add the script // to instead. var script = document.createElement('script'); -script.textContent = js; +script.textContent = checkForOld + js; document.documentElement.appendChild(script); script.parentNode.removeChild(script);