Member Junction
    Preparing search index...

    A runtime hook that can be registered to execute at key lifecycle points in the React root manager. All methods are optional — implement only the lifecycle points you need.

    interface RuntimeHook {
        name: string;
        OnCleanup?: () => void;
        OnFirstRootCreated?: (context: RootHookContext) => void;
        OnRootCreated?: (context: RootHookContext) => void;
        OnRootUnmounted?: (rootId: string) => void;
    }
    Index

    Properties

    name: string

    Human-readable name for debugging/logging

    OnCleanup?: () => void

    Called during runtime shutdown (ReactRootManager.cleanup()). Use this to disconnect observers, remove injected DOM elements, clear timers, etc.

    OnFirstRootCreated?: (context: RootHookContext) => void

    Called once, when the very first React root is created. Use this for one-time global setup (e.g., injecting global styles, creating MutationObservers, etc.).

    OnRootCreated?: (context: RootHookContext) => void

    Called after every root is created (including the first).

    OnRootUnmounted?: (rootId: string) => void

    Called after a root is unmounted.