Package Exports
- @rc-component/portal
- @rc-component/portal/es/index.js
- @rc-component/portal/lib/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@rc-component/portal) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
rc-portal
React 18 supported Portal Component.
Development
npm install
npm start
open http://localhost:8000
Feature
- React life cycle support portal component
Install
Usage
import Portal from '@rc-component/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 |