Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Blazor p8] OnInitializedAsync is executed for twice on pre-render #3273

Closed
ctrl-alt-d opened this issue Aug 28, 2019 · 2 comments
Closed

[Blazor p8] OnInitializedAsync is executed for twice on pre-render #3273

ctrl-alt-d opened this issue Aug 28, 2019 · 2 comments

Comments

@ctrl-alt-d
Copy link

Issue

OnInitializedAsync is executed for twice on pre-render

General

[dani@localhost tw]$ dotnet --version
3.0.100-preview8-013656

I wrote this code:

@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:

prerender2

Has it some explanation?

The question on stackoverfow: Blazor UriHelper.NavigateTo is calling the page twice

@hez2010
Copy link

hez2010 commented Sep 1, 2019

I think blazor related issues should be posted in AspNetCore repo:
https://github.com/aspnet/AspNetCore

@ctrl-alt-d
Copy link
Author

Of course @hez2010 , thanks: dotnet/aspnetcore#13607

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants