misc_pterodactyl-panel/resources/scripts/components/elements/Portal.tsx

10 lines
300 B
TypeScript
Raw Normal View History

2022-11-25 20:25:03 +00:00
import { useRef } from 'react';
import * as React from 'react';
2022-06-20 18:16:42 +00:00
import { createPortal } from 'react-dom';
export default ({ children }: { children: React.ReactNode }) => {
const element = useRef(document.getElementById('modal-portal'));
return createPortal(children, element!.current!);
};