Practice
A portal is the recommended way to render children into a DOM node that exists outside the DOM hierarchy of the parent component.
ReactDOM.createPortal(child, container)
The first argument is any renderable React child, such as an element, a string or a fragment. The second argument is a DOM element.
Comments