mirror of
https://github.com/pterodactyl/panel.git
synced 2026-12-01 03:45:53 -05:00
8 lines
346 B
TypeScript
8 lines
346 B
TypeScript
import React from 'react';
|
|
import { createPortal } from 'react-dom';
|
|
|
|
/** Renders `children` into the page's overlay layer, or the body where there is none, as in tests. */
|
|
export default function Portal({ children }: { children: React.ReactNode }) {
|
|
return createPortal(children, document.getElementById('modal-portal') ?? document.body);
|
|
}
|