carbontsunami
carbontsunami
CC#
Created by SaschaXVII on 11/22/2023 in #help
.NET 8, Blazor InteractiveServer with StreamRendering causing double rendering
private List<TodoItem>? todos; protected override async Task OnInitializedAsync() { // } protected override async Task OnAfterRenderAsync(bool firstRender) { if (firstRender) { await Task.Delay(1000); // love the new collection expressions btw!! todos = [new TodoItem(), new TodoItem(), new TodoItem()]; StateHasChanged(); } }
3 replies
CC#
Created by SaschaXVII on 11/22/2023 in #help
.NET 8, Blazor InteractiveServer with StreamRendering causing double rendering
to prevent from double rendering there is a way to do. You can move your loading code from OnInitializedAsync to OnAfterRenderAsync
3 replies