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

Commit 8e3e128

Browse files
committed
add warning when you have both the official version and the beta
1 parent a2943a3 commit 8e3e128

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

shells/chrome/src/GlobalHook.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,20 @@
1515

1616
var globalHook = require('../../../backend/GlobalHook.js');
1717

18+
// TODO: remove for release
19+
var checkForOld = `
20+
if (window.__REACT_DEVTOOLS_GLOBAL_HOOK__) {
21+
console.error("REACT DEVTOOLS ERROR\\nYou need to disable the official version of React Devtools in order to use the beta.");
22+
}
23+
`
24+
1825
var js = (
19-
'(' + globalHook.toString() + '(window))'
26+
';(' + globalHook.toString() + '(window))'
2027
);
2128

2229
// This script runs before the <head> element is created, so we add the script
2330
// to <html> instead.
2431
var script = document.createElement('script');
25-
script.textContent = js;
32+
script.textContent = checkForOld + js;
2633
document.documentElement.appendChild(script);
2734
script.parentNode.removeChild(script);

0 commit comments

Comments
 (0)