16 lines
300 B
TypeScript
16 lines
300 B
TypeScript
|
import React from 'react';
|
||
|
import ReactDOM from 'react-dom';
|
||
|
|
||
|
interface IPortal {
|
||
|
children: React.ReactNode
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Portal
|
||
|
*/
|
||
|
const Portal: React.FC<IPortal> = ({ children }) => ReactDOM.createPortal(
|
||
|
children,
|
||
|
document.querySelector('#soapbox') as HTMLDivElement,
|
||
|
);
|
||
|
|
||
|
export default Portal;
|