@samitouri / QOS-React / commits / 50b6b1d5f9

Added some inline comments about portal props

Brian Vaughn committed Mar 18, 2019 at 09:57 UTC 50b6b1d5f9e8a3284971ca0b464fb88ce3f925ba
1 file changed +13 -4
src/devtools/views/DevTools.js
+13 -4
@@ -27,13 +27,22 @@ export type Props = {|
27 browserName: BrowserName,
28 browserTheme: BrowserTheme,
29 defaultTab?: TabID,
30 - elementsPortalContainer?: Element,
31 - overrideTab?: TabID,
32 - profilerPortalContainer?: Element,
33 - settingsPortalContainer?: Element,
30 showTabBar?: boolean,
31 store: Store,
32 viewElementSource?: ?Function,
33 +
34 + // This property is used only by the web extension target.
35 + // The built-in tab UI is hidden in that case, in favor of the browser's own panel tabs.
36 + // This is done to save space within the app.
37 + // Because of this, the extension needs to be able to change which tab is active/rendered.
38 + overrideTab?: TabID,
39 +
40 + // To avoid potential multi-root trickiness, the web extension uses portals to render tabs.
41 + // The root <DevTools> app is rendered in the top-level extension window,
42 + // but individual tabs (e.g. Elements, Profiling) can be rendered into portals within their browser panels.
43 + elementsPortalContainer?: Element,
44 + profilerPortalContainer?: Element,
45 + settingsPortalContainer?: Element,
46 |};
47
48 const elementTab = {