Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 4 additions & 10 deletions aspnetcore/blazor/components/render-modes.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,25 +217,19 @@ Additional information on render mode propagation is provided in the [Render mod

## Detect rendering location, interactivity, and assigned render mode at runtime

<!-- UPDATE 9.0 Renaming of API for Pre6:
Update the content and remove the NOTE -->
The `ComponentBase.RendererInfo` and `ComponentBase.AssignedRenderMode` properties permit the app to detect details about the location, interactivity, and assigned render mode of a component:

The `ComponentBase.Platform` and `ComponentBase.AssignedRenderMode` properties permit the app to detect details about the location, interactivity, and assigned render mode of a component:

* `Platform.Name` returns the location where the component is executing:
* `RendererInfo.Name` returns the location where the component is executing:
* `Static`: On the server (SSR) and incapable of interactivity.
* `Server`: On the server (SSR) and capable of interactivity after prerendering.
* `WebAssembly`: On the client (CSR) and capable of interactivity after prerendering.
* `WebView`: On the native device and capable of interactivity after prerendering.
* `Platform.IsInteractive` indicates if the component supports interactivity at the time of rendering. The value is `true` when rendering interactively or `false` when prerendering or for static SSR (`Platform.Name` of `Static`).
* `RendererInfo.IsInteractive` indicates if the component supports interactivity at the time of rendering. The value is `true` when rendering interactively or `false` when prerendering or for static SSR (`Platform.Name` of `Static`).
* `ComponentBase.AssignedRenderMode` exposes the component's assigned render mode:
* `InteractiveServer` for Interactive Server.
* `InteractiveAuto` for Interactive Auto.
* `InteractiveWebassembly` for Interactive WebAssembly.

> [!NOTE]
> `ComponentBase.Platform` will be renamed to `ComponentBase.RendererInfo` in a future preview release.

Components use these properties to render content depending on their location or interactivity status. For example, a form can be disabled during prerendering and enabled when the component becomes interactive:

```razor
Expand All @@ -258,7 +252,7 @@ Components use these properties to render content depending on their location or
{
Movie ??= await ...;

if (Platform.IsInteractive)
if (RendererInfo.IsInteractive)
{
disabled = false;
}
Expand Down
4 changes: 0 additions & 4 deletions aspnetcore/release-notes/aspnetcore-9/includes/blazor.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,8 @@ We've introduced a new API designed to simplify the process of querying componen
* **Check if the component is running in an interactive environment**: This can be helpful for components that have different behaviors based on the interactivity of their environment.
* **Retrieve the assigned render mode for the component**: Understanding the render mode can help in optimizing the rendering process and improving the overall performance of a component.

<!-- ACTIVATE THIS LINK AFTER https://github.com/dotnet/AspNetCore.Docs/pull/32794 merges

For more information, see <xref:blazor/components/render-modes?view=aspnetcore-9.0#detect-rendering-location-interactivity-and-assigned-render-mode-at-runtime>.

-->

### Improved server-side reconnection experience:

The following enhancements have been made to the default server-side reconnection experience:
Expand Down