Clean up all roots (for testing or shutdown)
Create a new managed React root
The DOM container element
Function to create the React root (e.g., ReactDOM.createRoot)
OptionalcomponentId: stringOptional component ID for resource tracking
The root ID for future operations
Get statistics about managed roots
Check if a root is currently rendering
The root ID
true if rendering
Register a runtime hook to be called at lifecycle points. Hooks execute in registration order.
The hook to register
Remove a previously registered hook by name.
The name of the hook to remove
true if a hook was found and removed
Safely render content to a React root
The root ID
React element to render
OptionalonComplete: () => voidOptional callback when render completes
Unmount all roots associated with a component
The component ID
Safely unmount a React root
The root ID
Force unmount even if rendering
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.