React has a createPortal API to render a child node in a container node: ReactDOM.createPortal(child, container); The container node can be anywhere in the DOM. This enables interesting use cases such as injecting app-level overlays, e.g. Modal, Banner, and Toast to document.body : render() {
return ReactDOM.createPortal(this.props.children, document.body);
} How…