UNPKG

1.44 kBTypeScriptView Raw
1import * as React from 'react';
2import type { InternalTheme } from 'src/types';
3import PortalHost from './PortalHost';
4export declare type Props = {
5 /**
6 * Content of the `Portal`.
7 */
8 children: React.ReactNode;
9 /**
10 * @optional
11 */
12 theme: InternalTheme;
13};
14/**
15 * Portal allows rendering a component at a different place in the parent tree.
16 * You can use it to render content which should appear above other elements, similar to `Modal`.
17 * It requires a [`Portal.Host`](PortalHost) component to be rendered somewhere in the parent tree.
18 * Note that if you're using the `Provider` component, this already includes a `Portal.Host`.
19 *
20 * ## Usage
21 * ```js
22 * import * as React from 'react';
23 * import { Portal, Text } from 'react-native-paper';
24 *
25 * const MyComponent = () => (
26 * <Portal>
27 * <Text>This is rendered at a different place</Text>
28 * </Portal>
29 * );
30 *
31 * export default MyComponent;
32 * ```
33 */
34declare class Portal extends React.Component<Props> {
35 static Host: typeof PortalHost;
36 render(): React.JSX.Element;
37}
38declare const _default: React.ComponentType<Pick<Props, "children"> & {
39 theme?: import("@callstack/react-theme-provider").$DeepPartial<unknown> | undefined;
40}> & import("@callstack/react-theme-provider/typings/hoist-non-react-statics").NonReactStatics<React.ComponentType<Props> & typeof Portal, {}>;
41export default _default;
42//# sourceMappingURL=Portal.d.ts.map
\No newline at end of file