Class ComponentState<T>
Typed wrapper around Blazor component render state information.
Inherited Members
Namespace: FastMoq.Web.Blazor.Models
Assembly: FastMoq.Web.dll
Syntax
public class ComponentState<T> : ComponentState where T : ComponentBase
Type Parameters
| Name | Description |
|---|---|
| T | The component type represented by the state wrapper. |
Remarks
FastMoq uses this wrapper instead of exposing raw renderer internals directly because bUnit 2 changed the shape of the renderer state it stores for rendered components. Consumers should prefer GetOrCreateRenderedComponent(Type) or GetOrCreateRenderedComponent<T>() over reflecting on renderer state objects themselves.
Constructors
ComponentState(object?, BunitRenderer, IRenderedComponent<IComponent>?)
Initializes a new instance of the ComponentState<T> class.
Declaration
public ComponentState(object? obj, BunitRenderer renderer, IRenderedComponent<IComponent>? rootComponent = null)
Parameters
| Type | Name | Description |
|---|---|---|
| object | obj | The raw renderer state object. |
| BunitRenderer | renderer | The renderer. |
| IRenderedComponent<IComponent> | rootComponent | The rendered root component used for nested component lookups when needed. |
Properties
Component
Gets the component.
Declaration
public T? Component { get; }
Property Value
| Type | Description |
|---|---|
| T | The component. |