member-login-h5/node_modules/@rc-component/portal
huyunkun 5ed809faa0 提交 2026-05-10 11:20:32 +08:00
..
es 提交 2026-05-10 11:20:32 +08:00
lib 提交 2026-05-10 11:20:32 +08:00
LICENSE 提交 2026-05-10 11:20:32 +08:00
README.md 提交 2026-05-10 11:20:32 +08:00
package.json 提交 2026-05-10 11:20:32 +08:00

README.md

rc-portal

React 18 supported Portal Component.

NPM version dumi build status Codecov npm download

Development

npm install
npm start
open http://localhost:8000

Feature

  • React life cycle support portal component

Install

rc-portal

Usage

import Portal from 'rc-portal';

const Demo = () => {
  return <Portal open>Hello World</Portal>;
};

export default Demo;

🔥 API

We use typescript to create the Type definition. You can view directly in IDE. But you can still check the type definition here.

Portal

Prop Description Type Default
getContainer Customize portal container element Element | () => Element document.body
open Show the portal boolean false
autoLock Lock screen scroll when open boolean false