npm.io
1.2.0 • Published 6 years ago

react-widget-portal

Licence
MIT
Version
1.2.0
Deps
1
Size
13 kB
Vulns
0
Weekly
0

react-widget-portal

npm install --save react-widget-portal

import Portal from 'react-widget-portal';

<Portal container={document.body}>
    <div>Hello Portal</div>
</Portal>

Interface

interface PortalProps {
    /** 渲染容器,默认为:document.body */
    container?: HTMLElement | Promise<HTMLElement | null> | null;
    /** 初始渲染时触发,注:如果container为null时不会触发,直到container存在 */
    onChildrenMount?: () => void;
}

Keywords