The Wayback Machine - https://web.archive.org/web/20220125003555/https://github.com/dotnet/aspnetcore/issues/39740
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 server renders twice resulting in static HTML animation showing twice #39740

Open
aryehsilver opened this issue Jan 25, 2022 · 1 comment
Open

Comments

@aryehsilver
Copy link

@aryehsilver aryehsilver commented Jan 25, 2022

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 .

I also have published live where you can see it in action (using a slow connection) .

Here is a clip of the animation in action.

Blazor.Double.Render.mp4
@aryehsilver
Copy link
Author

@aryehsilver aryehsilver commented Jan 25, 2022

The links seem to have disappeared and I can no longer edit the post.

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://doublerender.alldevstaging.co.uk/.

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

Successfully merging a pull request may close this issue.

None yet
1 participant