Portal
Used to render a component outside the DOM hierarchy of the parent component.
Anatomy
This component is a utility and does not render any DOM elements.
Import
import { Portal } from '@pluralsight/react'
Usage
Basic
Result
Loading...
Live Editor
Behavior
There are no behaviors associated with this component.
API
Parameters
interface PortalProps {
mount?: HTMLElement
key?: string
}
mount
: The DOM node to mount the portal to. Defaults todocument.body
.key
: The key to use for the portal. Defaults toundefined
.
Accessibility
There is no special accessibility considerations for this component.