Skip to content

Identifying whether the page is server or client for RenderMode.Auto  #50859

Closed
@gragra33

Description

@gragra33

Is there an existing issue for this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe the problem.

Whilst writing components to support all render modes is preferred, there may be cases where it is not always possible.

Describe the solution you'd like

For these cases, having a property or method with the running state for the component on the ComponentBase class would make this possible.

Additional context

A current workaround is to check the IJSRuntime interface for if it inherits IJSInProcessRuntime. Here is my current workaround: Blazor.WhereAmIRunning. The sample project visually demonstrates how it works.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-blazorIncludes: Blazor, Razor Components

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions