The RenderFragment is used to create a component dynamically.
@page "/"
@CreateDynamicComponent();
@code {
RenderFragment CreateDynamicComponent() => builder =>
{
builder.OpenComponent(0, typeof(SurveyPrompt));
builder.AddAttribute(1, "Title", "Some title");
builder.CloseComponent();
};
}
Share with