mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-01-17 14:37:05 +01:00
13 lines
319 B
TypeScript
13 lines
319 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);
|
|
}
|