Blazor server renders twice resulting in static HTML animation showing twice #39740
Labels
area-blazor
Includes: Blazor, Razor Components
enhancement
This issue represents an ask for new feature or an enhancement to an existing one
feature-blazor-server
feature-rendering
Features dealing with how blazor renders components
✔️ Resolution: Duplicate
Resolved as a duplicate of another issue
Status: Resolved
Milestone
All over the web there have been discussions about how Blazor server hits the
OnInitialized
method twice, once in prerendering and again after the connection has been established in the browser.All the above address data and how to preserve the state after prerendering.
I am using .Net 6 and have a pure static HTML razor component that has an animation done in CSS. The animation occurs twice.
In development this occurs so fast that it is almost not conceivable to the user. The same when live but using a strong internet connection. When accessing it via a slow internet connection the animation occurs twice.
I have created a reproducible solution which shows the effect https://github.com/aryehsilver/BlazorDoubleRenderTest.
I also have published live where you can see it in action (using a slow connection) https://projects.aryehsilver.co.uk/double-render.
Here is a clip of the animation in action.
Blazor.Double.Render.mp4
The text was updated successfully, but these errors were encountered: