Portal

Portal

The API documentation of the Portal React component.

Portals provide a first-class way to render children into a DOM node that exists outside the DOM hierarchy of the parent component.

Props

Name Type Default Description
childrenĀ * node The children to render into the container.
container union: object |
 func
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.
disablePortal bool false Disable the portal behavior. The children stay within it's parent DOM hierarchy.
onRendered func Callback fired once the children has been mounted into the container.

Any other properties supplied will be spread to the root element (native element).

Demos