registerComponent function

void registerComponent(
  1. String tagName,
  2. ComponentFactory factory
)

Registers a component factory for hydration.

Call this for each component type before calling hydrateComponents.

Example

void main() {
  registerComponent('my-counter', Counter.new);
  hydrateAll();
}

Implementation

void registerComponent(String tagName, ComponentFactory factory) {
  _componentRegistry[tagName.toLowerCase()] = factory;
}