Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

Hybrid Blazor application slow/sluggish navigation

$
0
0

I started off with a Blazor Server application for a website initially, but then figured I could use static rendering with "Enhance" EditForms and interactive webassembly rendering to eliminate the possiblity of one of the rendered components losing SignalR connection, so I turned the project into a Webassemby/Server hybrid. The idea was that the navigation bar component could have interactive webassembly rendering.

I use the injected NavigationManager to navigate to static/interactive server rendering components inside the server project in the navigation bar component, which is located inside the WebAssembly SDK Client project.

The problem is, the onclick events of the menu items became sluggish all of a sudden. It took 2, 3 or 4 clicks until the method associated with the menu item fired. I found out that this sluggishness occurs after a navigation request, as if it has become MUCH slower. I navigate to a component, and it takes a good 5 seconds until I can fire the next navigation.

I can tell the difference, as I did not experience it until the navigation bar was rendered as interactive server.

Am I doing something wrong?

Here is my navigation bar:

@inject NavigationManager Nav@rendermode InteractiveWebAssembly...<a id="homelink" @onclick="home">BlaBlaBla</a>...@code {    private void login() => Nav.NavigateTo("/Login", true);    private void account() => Nav.NavigateTo("/Account");    private void contact() => Nav.NavigateTo("/Contact", true);    private void home() => Nav.NavigateTo("/");}

Login component is statically rendered (inevitable for Cookie authentication), Contact and Account has interactive server rendermode.


Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>