¥Portal
在 DOM 的不同部分渲染 React 子树。
Render any React subtree outside of your App.
Appends to `document.body` by default but can be customized to use a different container.
¥Installation
从命令行安装组件。
¥Install the component from your command line.
¥Anatomy
导入组件。
¥Import the component.
¥Basic example
使用门户基础组件。
¥Use the portal primitive.
¥API Reference
¥Root
你放入此组件中的任何内容都将在单独的 <div>
元素中渲染。默认情况下,此元素将附加到 document.body
,但你可以使用 container
属性选择其他容器。
¥Anything you put inside this component will be rendered in a separate <div>
element. By default, this element will be appended to document.body
but you can choose a different container by using the container
prop.