Skip to content
0:00 / 0:00

#blazor#.net8#ssr

The Biggest ISSUE With Blazor (and how to fix it)

Codewrinkles

35K subscribers • 2 videos on Hallway

YouTube
  • Recommended by 2 people: 2 in engineering communities.
  • May be out of date. The tools, versions or practices it shows have likely moved on.

Intermediate. Assumes working knowledge.

14K views2 years ago2 recommendations

Web developmentVue, Svelte, Angular and othersWeb performance

How to resolve the issue where Blazor's OnInitialized method is called twice during the transition from pre-rendering to interactive rendering.

One of the biggest issues with Blazor in .NET 8 is that it doesn't offer a smooth transition from the pre-rendering to interactive rendering. In practice, we end up having the OnInitialized method being called twice. Which can render our applications unusable. However, there's an easy fix for that! In this video I will show you exactly what the problem is and how to solve it! #dotnet #blazor #aspnetcore JOIN the Codewrinkles newsletter: codewrinkles.eo.page/newsletter Join this channel to get source code access and other perks: youtube.com/channel/UCyTPru-1gZ7-4qblcKM0TiQ/join CONTENT 1. Intro: 2. Regular SSR: 3. SSR + interactivity = TROUBLE: 4. Let's fix it!

Why it's here

2 people recommend this

What people say. Recommended for troubleshooting state and double-rendering issues in .NET 8 Blazor applications.

u/Two_Thirty_Sevenin r/dotnet • Recommends

On “Confused About the New Blazor Web App”

This might help link to this video

u/3aseerin r/dotnet • Recommends

On “Blazor Server cheap hosting options?”

I did check his videos out and that's how i narrowed down the issue quite a bit, it wasn't a Db context factory issue it was the double rendering issue which he also has a link to this video on. I'm saying this as the same not getting data properly issue mainly happened when I tried to use the SuppyParameterFromQuery attribute so I'm almost certain of the issue being related to OnInitalizedAsync being called twice. I have found another way around it however and don't want to mess with my code so I can't fully confirm it quite yet.