The content or node you'll like to portal
Portal
Renders a component outside the current DOM hierarchy.
Props#
children
required
children
required
ReactNode
appendToParentPortal
appendToParentPortal
If true
, the portal will check if it is within a parent portal
and append itself to the parent's portal node.
This provides nesting for portals.
If false
, the portal will always append to `document.body`
regardless of nesting. It is used to opt out of portal nesting.
boolean
true
containerRef
containerRef
The ref
to the component where the portal will be attached to.
RefObject<HTMLElement | null>
Props#
children
required
children
required
The content or node you'll like to portal
ReactNode
appendToParentPortal
appendToParentPortal
If true
, the portal will check if it is within a parent portal
and append itself to the parent's portal node.
This provides nesting for portals.
If false
, the portal will always append to `document.body`
regardless of nesting. It is used to opt out of portal nesting.
boolean
true
containerRef
containerRef
The ref
to the component where the portal will be attached to.
RefObject<HTMLElement | null>