UNPKG

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