UNPKG

735 BTypeScriptView Raw
1import PropTypes from 'prop-types';
2import React from 'react';
3import { DOMContainer } from './useWaitForDOMRef';
4export interface PortalProps {
5 children: React.ReactElement;
6 container: DOMContainer;
7 onRendered?: (element: any) => void;
8}
9/**
10 * @public
11 */
12declare const Portal: {
13 ({ container, children, onRendered }: PortalProps): JSX.Element | null;
14 displayName: string;
15 propTypes: {
16 /**
17 * A DOM element, Ref to an element, or function that returns either. The `container` will have the Portal children
18 * appended to it.
19 */
20 container: PropTypes.Requireable<any>;
21 onRendered: PropTypes.Requireable<(...args: any[]) => any>;
22 };
23};
24export default Portal;