UNPKG

@littlespoon/drawer

Version:
22 lines 946 B
import { ReactElement, ReactNode, ReactPortal } from 'react'; export type PortalContainerFunction = () => HTMLElement | null; export interface PortalProps { /** * The content of the component. */ children: ReactNode; /** * An HTML element or function that returns one. * The `container` will have the portal children appended to it. * By default, it uses the body of the top-level document object, so it's simply `document.body` most of the time. * @defaultValue `document.body` */ container?: HTMLElement | PortalContainerFunction; } /** * Portals provide a first-class way to render children into a DOM node that exists outside the DOM hierarchy of the parent component. * @see https://reactjs.org/docs/portals.html * @param props - Properties */ export default function Portal({ children, container, }: PortalProps): ReactPortal | ReactElement | null; //# sourceMappingURL=Portal.d.ts.map