RenderRequest
The input to {@see \Milpa\Live\Contracts\Rendering\ComponentRendererInterface::render()}. When `$state` is `null`, the renderer MUST mount the component fresh from `$props`/`$context`; when `$state` is given, the renderer renders that snapshot as-is (`$props` is then only consulted as a fallback for values not already captured in state — see e.g. {@see \Milpa\Live\Rendering\ViewModel\DashboardViewModelFields}'s meta-over-props precedence).
RenderRequest::__construct()
public function __construct(Milpa\Live\ValueObjects\ComponentContext $context, array $props = [], ?Milpa\Live\ValueObjects\StateSnapshot $state = null, Milpa\Live\ValueObjects\RenderTarget $target = Milpa\Live\ValueObjects\RenderTarget::HTML, array $options = []):Parameters
| Name | Type | Description |
|---|---|---|
| $context | ComponentContext | The render-target-agnostic context to mount/render within. |
| $props | array<string, mixed> | Props to mount with, or to fall back to when `$state` is given. |
| $state | (StateSnapshot | null) | An already-mounted snapshot to render as-is, or `null` to mount fresh. |
| $target | RenderTarget | Which target this request is for; renderers MUST reject a request whose target they do not {@see \Milpa\Live\Contracts\Rendering\ComponentRendererInterface::supportsTarget()}. |
| $options | array<string, mixed> | Target-specific rendering options (e.g. TUI's `width`/`focused`/`cursor`). |