1 | import * as React from 'react';
|
2 |
|
3 | export interface PortalProps {
|
4 | /**
|
5 | * The children to render into the `container`.
|
6 | */
|
7 | children?: React.ReactNode;
|
8 | /**
|
9 | * A HTML element, component instance, or function that returns either.
|
10 | * The `container` will have the portal children appended to it.
|
11 | *
|
12 | * By default, it uses the body of the top-level document object,
|
13 | * so it's simply `document.body` most of the time.
|
14 | */
|
15 | container?: React.ReactInstance | (() => React.ReactInstance | null) | null;
|
16 | /**
|
17 | * Disable the portal behavior.
|
18 | * The children stay within it's parent DOM hierarchy.
|
19 | */
|
20 | disablePortal?: boolean;
|
21 | /**
|
22 | * Callback fired once the children has been mounted into the `container`.
|
23 | *
|
24 | * This prop will be removed in v5, the ref can be used instead.
|
25 | * @deprecated Use the ref instead.
|
26 | */
|
27 | onRendered?: () => void;
|
28 | }
|
29 |
|
30 | /**
|
31 | * Portals provide a first-class way to render children into a DOM node
|
32 | * that exists outside the DOM hierarchy of the parent component.
|
33 | * Demos:
|
34 | *
|
35 | * - [Portal](https://mui.com/components/portal/)
|
36 | *
|
37 | * API:
|
38 | *
|
39 | * - [Portal API](https://mui.com/api/portal/)
|
40 | */
|
41 | export default function Portal(props: PortalProps): JSX.Element;
|