Member Junction
    Preparing search index...

    Manages React root instances to prevent memory leaks and ensure proper cleanup. Handles safe rendering and unmounting with protection against concurrent operations.

    Supports a pluggable hook system so host environments (Angular, Vue, etc.) and library integrations can inject behavior at key lifecycle points without coupling the generic runtime to specific libraries or frameworks.

    Index

    Constructors

    Methods

    • Create a new managed React root

      Parameters

      • container: HTMLElement

        The DOM container element

      • createRootFn: (container: HTMLElement) => any

        Function to create the React root (e.g., ReactDOM.createRoot)

      • OptionalcomponentId: string

        Optional component ID for resource tracking

      Returns string

      The root ID for future operations

    • Get statistics about managed roots

      Returns { pendingUnmounts: number; renderingRoots: number; totalRoots: number }

    • Remove a previously registered hook by name.

      Parameters

      • hookName: string

        The name of the hook to remove

      Returns boolean

      true if a hook was found and removed

    • Safely render content to a React root

      Parameters

      • rootId: string

        The root ID

      • element: any

        React element to render

      • OptionalonComplete: () => void

        Optional callback when render completes

      Returns void

    • Safely unmount a React root

      Parameters

      • rootId: string

        The root ID

      • force: boolean = false

        Force unmount even if rendering

      Returns Promise<void>