react-portal-target
Version:
React portals which target another location in the React component tree
16 lines (15 loc) • 577 B
TypeScript
import { FunctionComponent, ReactNode } from 'react';
declare const PortalContext: FunctionComponent<{
children: ReactNode;
}>;
declare const usePortalSource: (name: string, content: ReactNode) => void;
declare const usePortalTarget: (name: string, fallbackContent?: ReactNode) => ReactNode;
declare const PortalSource: FunctionComponent<{
name: string;
children?: ReactNode;
}>;
declare const PortalTarget: FunctionComponent<{
name: string;
children?: ReactNode;
}>;
export { PortalContext, PortalSource, PortalTarget, usePortalSource, usePortalTarget, };