misc_pterodactyl-panel/resources/scripts/components/elements/Portal.tsx
2022-11-25 13:25:03 -07:00

9 lines
300 B
TypeScript

import { useRef } from 'react';
import * as React from 'react';
import { createPortal } from 'react-dom';
export default ({ children }: { children: React.ReactNode }) => {
const element = useRef(document.getElementById('modal-portal'));
return createPortal(children, element!.current!);
};