This article explains how React handles state updates across different platforms by separating the component definition package from the renderers. It details the use of dependency injection, specifically how the `updater` object and dispatchers allow the generic `react` package to trigger platform-specific reconciliation without direct coupling.
Key points
The `react` package is platform-agnostic and only defines components, while renderers (e.g., `react-dom`, `react-native`) contain the logic for updates.
Dependency injection is used to pass platform-specific implementation details into the shared `React.Component` base class.
State updates occur by delegating functionality from the component to an `updater` object or a `dispatcher` provided by the active renderer.
Separating definition from implementation enables React to use the same component code across different environments like browsers, mobile, and testing utilities.