reablocks
Version:
Component library for React
32 lines (30 loc) • 727 B
TypeScript
import { CSSProperties, FC, PropsWithChildren, LegacyRef } from 'react';
export interface PortalProps extends PropsWithChildren {
/**
* Element to create for the portal.
*/
element?: string;
/**
* Class name to apply to the portal element.
*/
className?: string;
/**
* Style to apply to the portal element.
*/
style?: CSSProperties;
/**
* Callback for portal mounts.
*/
onMount?: () => void;
/**
* Callback for portal unmounts.
*/
onUnmount?: () => void;
}
export interface PortalRef {
/**
* Reference to the portal element.
*/
ref?: LegacyRef<HTMLElement>;
}
export declare const Portal: FC<PortalProps & PortalRef>;