Miss any of our Open RFC calls?Watch the recordings here! »

react-widget-portal

1.2.0 • Public • Published

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;
}

Install

npm i react-widget-portal

DownloadsWeekly Downloads

36

Version

1.2.0

License

MIT

Unpacked Size

13 kB

Total Files

7

Last publish

Collaborators

  • avatar