add support for react dev tools in the cosmos explorer (#1788)
This commit is contained in:
parent
3c5d899e47
commit
f533eeb0fc
|
@ -1,3 +1,6 @@
|
||||||
|
// Import this first, to ensure that the dev tools hook is copied before React is loaded.
|
||||||
|
import "./ReactDevTools";
|
||||||
|
|
||||||
// CSS Dependencies
|
// CSS Dependencies
|
||||||
import { initializeIcons, loadTheme } from "@fluentui/react";
|
import { initializeIcons, loadTheme } from "@fluentui/react";
|
||||||
import { QuickstartCarousel } from "Explorer/Quickstart/QuickstartCarousel";
|
import { QuickstartCarousel } from "Explorer/Quickstart/QuickstartCarousel";
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
if (window.parent !== window) {
|
if (window.parent !== window) {
|
||||||
(window as any).__REACT_DEVTOOLS_GLOBAL_HOOK__ = (window.parent as any).__REACT_DEVTOOLS_GLOBAL_HOOK__;
|
try {
|
||||||
|
(window as any).__REACT_DEVTOOLS_GLOBAL_HOOK__ = (window.parent as any).__REACT_DEVTOOLS_GLOBAL_HOOK__;
|
||||||
|
} catch {
|
||||||
|
// No-op. We can throw here if the parent is not the same origin (such as in the Azure portal).
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue