portaledContent.js — react Source File
Architecture documentation for portaledContent.js, a javascript file in the react codebase. 6 imports, 4 dependents.
Entity Profile
Dependency Diagram
graph LR 112f19f5_c561_f36f_4f9c_12048819ad24["portaledContent.js"] bc8655f0_277c_51b9_bdf3_da523644e54b["index.js"] 112f19f5_c561_f36f_4f9c_12048819ad24 --> bc8655f0_277c_51b9_bdf3_da523644e54b 913bb343_55ea_f1b8_08f5_b75cb0a92b76["context.js"] 112f19f5_c561_f36f_4f9c_12048819ad24 --> 913bb343_55ea_f1b8_08f5_b75cb0a92b76 4d06d539_1d59_0b26_1097_d40ffb862127["ThemeProvider.js"] 112f19f5_c561_f36f_4f9c_12048819ad24 --> 4d06d539_1d59_0b26_1097_d40ffb862127 b36f71ce_7163_22e3_79d7_b73d86269e76["ThemeProvider"] 112f19f5_c561_f36f_4f9c_12048819ad24 --> b36f71ce_7163_22e3_79d7_b73d86269e76 ac587885_e294_a1e9_b13f_5e7b920fdb42["react"] 112f19f5_c561_f36f_4f9c_12048819ad24 --> ac587885_e294_a1e9_b13f_5e7b920fdb42 4d0c4ccc_5970_e7f9_458f_15f0290099b1["react-dom"] 112f19f5_c561_f36f_4f9c_12048819ad24 --> 4d0c4ccc_5970_e7f9_458f_15f0290099b1 a2fac529_5caa_fd15_61d0_e5b11d75bdd2["Components.js"] a2fac529_5caa_fd15_61d0_e5b11d75bdd2 --> 112f19f5_c561_f36f_4f9c_12048819ad24 6b10ae9e_a560_a310_ddb0_99f0d8e5ab0c["EditorPane.js"] 6b10ae9e_a560_a310_ddb0_99f0d8e5ab0c --> 112f19f5_c561_f36f_4f9c_12048819ad24 2e59ff66_9c56_6e37_8843_8e474e6b0d70["Profiler.js"] 2e59ff66_9c56_6e37_8843_8e474e6b0d70 --> 112f19f5_c561_f36f_4f9c_12048819ad24 3249b7c1_ae10_2672_10ce_a66fd0ee6f60["SuspenseTab.js"] 3249b7c1_ae10_2672_10ce_a66fd0ee6f60 --> 112f19f5_c561_f36f_4f9c_12048819ad24 style 112f19f5_c561_f36f_4f9c_12048819ad24 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
*/
import * as React from 'react';
import {useContext} from 'react';
import {createPortal} from 'react-dom';
import ErrorBoundary from './ErrorBoundary';
import {StoreContext} from './context';
import ThemeProvider from './ThemeProvider';
export type Props = {portalContainer?: Element, ...};
export default function portaledContent(
Component: component(...props: any),
): component(...props: any) {
return function PortaledContent({portalContainer, ...rest}: Props) {
const store = useContext(StoreContext);
let children = (
<ErrorBoundary store={store}>
<Component {...rest} />
</ErrorBoundary>
);
if (portalContainer != null) {
// The ThemeProvider works by writing DOM style variables to an HTMLDivElement.
// Because Portals render in a different DOM subtree, these variables don't propagate.
// So in this case, we need to re-wrap portaled content in a second ThemeProvider.
children = (
<ThemeProvider>
<div
data-react-devtools-portal-root={true}
style={{
width: '100vw',
height: '100vh',
containerName: 'devtools',
containerType: 'inline-size',
}}>
{children}
</div>
</ThemeProvider>
);
}
return portalContainer != null
? createPortal(children, portalContainer)
: children;
};
}
Domain
Subdomains
Functions
Dependencies
- ThemeProvider
- ThemeProvider.js
- context.js
- index.js
- react
- react-dom
Imported By
Source
Frequently Asked Questions
What does portaledContent.js do?
portaledContent.js is a source file in the react codebase, written in javascript. It belongs to the BabelCompiler domain, Validation subdomain.
What functions are defined in portaledContent.js?
portaledContent.js defines 1 function(s): portaledContent.
What does portaledContent.js depend on?
portaledContent.js imports 6 module(s): ThemeProvider, ThemeProvider.js, context.js, index.js, react, react-dom.
What files import portaledContent.js?
portaledContent.js is imported by 4 file(s): Components.js, EditorPane.js, Profiler.js, SuspenseTab.js.
Where is portaledContent.js in the architecture?
portaledContent.js is located at packages/react-devtools-shared/src/devtools/views/portaledContent.js (domain: BabelCompiler, subdomain: Validation, directory: packages/react-devtools-shared/src/devtools/views).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free