TuiComponentInstance
One mounted Live component as seen by the terminal: pairs the component definition with the state snapshot it was mounted with, so a renderer can paint it without reaching back into the component registry.
TuiComponentInstance::__construct()
public function __construct(string $id, Milpa\Live\Contracts\Component\ComponentDefinitionInterface $component, Milpa\Live\ValueObjects\ComponentContext $context, array $props = [], ?Milpa\Live\ValueObjects\StateSnapshot $state = null, int $cursor = 0):Parameters
| Name | Type | Description |
|---|---|---|
| $id | string | |
| $component | Milpa\Live\Contracts\Component\ComponentDefinitionInterface | |
| $context | Milpa\Live\ValueObjects\ComponentContext | |
| $props | array<string, mixed> | |
| $state | ?Milpa\Live\ValueObjects\StateSnapshot | |
| $cursor | int |
TuiComponentInstance::componentName()
public function componentName(): stringThe contract name of the mounted component.
TuiComponentInstance::mountedState()
public function mountedState(): Milpa\Live\ValueObjects\StateSnapshotThe state snapshot this instance was mounted with.