react-widget-portal
TypeScript icon, indicating that this package has built-in type declarations

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

Dependencies (1)

Dev Dependencies (11)

Package Sidebar

Install

npm i react-widget-portal

Weekly Downloads

3

Version

1.2.0

License

MIT

Unpacked Size

13 kB

Total Files

7

Last publish

Collaborators

  • bplok20010