Files
yaak-mountain-loop/src-web/components/Portal.tsx
Gregory Schier a62d43be18 2024.5.1-beta.1 (#40)
Fix Linux and Windows launch errors
2024-06-04 15:02:14 -07:00

14 lines
320 B
TypeScript

import type { ReactNode } from 'react';
import { createPortal } from 'react-dom';
import { usePortal } from '../hooks/usePortal';
interface Props {
children: ReactNode;
name: string;
}
export function Portal({ children, name }: Props) {
const portal = usePortal(name);
return createPortal(children, portal);
}