Closed
Description
Issue
OnInitializedAsync
is executed for twice when page has been served as "pre-render".
Version
[dani@localhost tw]$ dotnet --version
3.0.100-preview8-013656
Steps to reproduce and screen shots:
@page "/"
@inject IUriHelper UriHelper
<h1>Hello, world!</h1>
Welcome to your new app.
@code{
protected async override Task OnInitializedAsync()
{
System.Console.WriteLine("_* ");
System.Console.WriteLine("_**************************");
System.Console.WriteLine("_***** Pre render ******");
System.Console.WriteLine("_**************************");
System.Console.WriteLine("_ ");
return;
}
}
And I see is executed for twice only on pre-render:
Has it some explanation?
The question on stackoverfow: Blazor UriHelper.NavigateTo is calling the page twice