Lilact
    Preparing search index...

    Function createPortal

    • Creates a portal — a way to render children into a DOM node that exists outside the current component hierarchy.

      Note: In React, events from portals propagate according to the React tree rather than the DOM tree. For example, if you click inside a portal, and the portal is wrapped in <div onClick>, that onClick handler will fire. Lilact doesn't act this way. In Lilact, event propagation follows DOM tree, while the ownership follow the JSX structure.

      Parameters

      • children: Component

        The component(s) to render into the portal.

      • element: Element

        The DOM node that will receive the portal content.

      Returns Component

      A portal object that can be rendered.