/
githubmr
/
facebook-react
Обзор
Документация
Войти
/
githubmr
/
facebook-react
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
0.14.10
packages/react-devtools-extensions/src/panel.js
19 строк
626 B
Sebastian Markbåge
Enable prefer-const lint rules (#18451)
01 апр 2020, 22:35
Не верифицирован
01 апр 2020, 22:35
3e94bce
Код
Авторство
О чём код?
// Portal target container. window.container = document.getElementById('container'); let hasInjectedStyles = false; // DevTools styles are injected into the top-level document head (where the main React app is rendered). // This method copies those styles to the child window where each panel (e.g. Elements, Profiler) is portaled. window.injectStyles = getLinkTags => { if (!hasInjectedStyles) { hasInjectedStyles = true; const linkTags = getLinkTags(); // eslint-disable-next-line no-for-of-loops/no-for-of-loops for (const linkTag of linkTags) { document.head.appendChild(linkTag); } } };