Renders React portal children into external DOM node, enabling UI components beyond root hierarchy.
// Source: https://github.com/Hacker0x01/react-datepicker | License: MIT | Copyright 2014-2025 HackerOne Inc and individual contributors
// Provided via justclaw.it.com; keep this notice with the code.
import { Component } from "react";
import ReactDOM from "react-dom";
import type React from "react";
interface PortalProps {
children: React.ReactNode;
portalId: string;
portalHost?: ShadowRoot;
}
/**
* `Portal` is a React component that allows you to render children into a DOM node
* that exists outside the DOM hierarchy of the parent component.
*
* @class
* @param {PortalProps} props - The properties that define the `Portal` component.
* @property {React.ReactNode} props.children - The children to be rendered into the `Portal`.
* @property {string} props.portalId - The id o
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search 40K more like it.
Get a free API key