Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
add warning when you have both the official version and the beta
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredly committed Aug 3, 2015
1 parent a2943a3 commit 8e3e128
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions shells/chrome/src/GlobalHook.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 <head> element is created, so we add the script
// to <html> instead.
var script = document.createElement('script');
script.textContent = js;
script.textContent = checkForOld + js;
document.documentElement.appendChild(script);
script.parentNode.removeChild(script);

0 comments on commit 8e3e128

Please sign in to comment.