Skip to content

Document how to display a loading UI for interactive WebAssembly rendering #31048

Closed
@danroth27

Description

@danroth27

[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:

  • 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.

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

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions