portal
v4.9.10arrow_drop_downThe children to render into the container
.
A node, component instance, or function that returns either.
The container
will have the portal children appended to it.
By default, it uses the body of the top-level document object,
so it’s simply document.body
most of the time.
Disable the portal behavior. The children stay within it’s parent DOM hierarchy.
Callback fired once the children has been mounted into the container
.
This prop will be deprecated and removed in v5, the ref can be used instead.
Portals provide a first-class way to render children into a DOM node that exists outside the DOM hierarchy of the parent component. Demos:
API:
Portals provide a first-class way to render children into a DOM node that exists outside the DOM hierarchy of the parent component.
Name | Type | Description |
---|---|---|
children | node | The children to render into the |
container | function | React.Component | typeof Element === 'undefined' ? Object : Element | A node, component instance, or function that returns either.
The |
disablePortal | bool | Disable the portal behavior. The children stay within it’s parent DOM hierarchy. |
onRendered | function | Callback fired once the children has been mounted into the This prop will be deprecated and removed in v5, the ref can be used instead. |