add support for react dev tools in the cosmos explorer (#1788)

This commit is contained in:
Ashley Stanton-Nurse
2024-04-04 09:16:23 -07:00
committed by GitHub
parent 3c5d899e47
commit f533eeb0fc
2 changed files with 8 additions and 1 deletions

View File

@@ -1,3 +1,7 @@
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).
}
}