MCPcopy Create free account
hub / github.com/callstack/react-native-paper / Portal

Class Portal

src/components/Portal/Portal.tsx:44–67  ·  view source on GitHub ↗

* Portal allows rendering a component at a different place in the parent tree. * You can use it to render content which should appear above other elements, similar to `Modal`. * It requires a [`Portal.Host`](PortalHost) component to be rendered somewhere in the parent tree. * Note that if you're

Source from the content-addressed store, hash-verified

42 * ```
43 */
44class Portal extends React.Component<Props> {
45 // @component ./PortalHost.tsx
46 static Host = PortalHost;
47
48 render() {
49 const { children, theme } = this.props;
50
51 return (
52 <SettingsConsumer>
53 {(settings) => (
54 <PortalContext.Consumer>
55 {(manager) => (
56 <PortalConsumer manager={manager as PortalMethods}>
57 <SettingsProvider value={settings}>
58 <ThemeProvider theme={theme}>{children}</ThemeProvider>
59 </SettingsProvider>
60 </PortalConsumer>
61 )}
62 </PortalContext.Consumer>
63 )}
64 </SettingsConsumer>
65 );
66 }
67}
68
69export default withInternalTheme(Portal);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…