You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We don't currently have a great way to display a loading UI for interactive WebAssembly rendering, but as @javiercnpointed out there is a way to do it:
Prerender a wrapper component that displays the placeholder on the page.
Inside the wrapper, render your component with prerender: false
Have the wrapper use @if(OsPlatform.IsBrowser()) to distinguish between SSR and WebAssembly and render your placeholder or the actual component.
@danroth27 ... Do you have an example of this? Also, the language of Javier's guidance doesn't make sense for routable Auto or WebAssembly components (with prerendering disabled). One wouldn't "Inside the wrapper, render your component with prerender: false" if the WASM/Auto component is found and loaded by the Blazor router, unless the wrapper component is wrapping the Blazor router in the Routes component, but I don't see how that's going to work. I need more info on both the scope and the workaround.
[EDIT by guardrex to add the metadata]
We don't currently have a great way to display a loading UI for interactive WebAssembly rendering, but as @javiercn pointed out there is a way to do it:
@if(OsPlatform.IsBrowser())
to distinguish between SSR and WebAssembly and render your placeholder or the actual component.Page URL
https://learn.microsoft.com/en-us/aspnet/core/blazor/fundamentals/startup?view=aspnetcore-8.0
Content source URL
https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/blazor/fundamentals/startup.md
Document ID
11f8db3d-9988-e0a1-89c5-c3552ee47b93
Article author
guardrex
The text was updated successfully, but these errors were encountered: