blazormauiblazor-hybrid

Blazor Hybrid Lifecycle


Navigating away from a component page, then back to the component page causes the component to be re-instantiated and go through the full lifecycle events (OnInitialized,SetParameters, etc.). Anyone else seeing this? Anyone know why?

I've flaggged each lifecycle event and I can confirm this behavior is occurring.


Solution

  • Blazor apps that prerender their content on the server call OnInitializedAsync twice:

    So, the ASP.NET Core Razor component lifecycle document gives the solutions Component initialization about the situation.