Артем Леванов
first commit
41a71fd
raw
history blame contribute delete
310 Bytes
import { ReactNode } from 'react';
import { createPortal } from 'react-dom';
interface PortalProps {
children: ReactNode;
element?: HTMLElement;
}
export const Portal = (props: PortalProps) => {
const { children, element = document.body } = props;
return createPortal(children, element);
};