Skip to content

Disable prerendering update 8.0 #30397

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

Merged
merged 1 commit into from
Sep 18, 2023
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
15 changes: 15 additions & 0 deletions aspnetcore/blazor/components/render-modes.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,21 @@ From the component definition:

In the preceding example, the `{ROUTE}` placeholder is the route template.

To disable prerendering for the entire app, indicate the render mode at the highest-level component in the app's component hierarchy that isn't a root component (root components can't be interactive). Typically, this is where the `Routes` component is used in the `App` component (`Components/App.razor`) for apps based on the Blazor Web App project template:

```razor
<Routes @rendermode="@(new ServerRenderMode(prerender: false))" />
```

Also, disable prerendering for the `HeadOutlet` component:

```razor
<HeadOutlet @rendermode="@(new ServerRenderMode(prerender: false))" />
```

> [!NOTE]
> The preceding syntax will be simplified in an upcoming preview release.

> [!NOTE]
> During .NET 8 *Release Candidate 1*, use the following values:
>
Expand Down
10 changes: 8 additions & 2 deletions aspnetcore/blazor/security/server/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -617,10 +617,16 @@ To avoid showing unauthorized content while prerendering with a [custom `Authent

:::moniker range=">= aspnetcore-8.0"

* Disable prerendering: Pass `false` to a server render mode attribute placed in the `Routes` component (`Routes.razor`):
* Disable prerendering: Indicate the render mode with the `prerender` parameter set to `false` at the highest-level component in the app's component hierarchy that isn't a root component (root components can't be interactive). Typically, this is where the `Routes` component is used in the `App` component (`Components/App.razor`) for apps based on the Blazor Web App project template:

```razor
<Routes @rendermode="@(new ServerRenderMode(prerender: false))" />
```
@attribute [RenderModeServer(false)]

Also, disable prerendering for the `HeadOutlet` component:

```razor
<HeadOutlet @rendermode="@(new ServerRenderMode(prerender: false))" />
```

:::moniker-end
Expand Down
10 changes: 8 additions & 2 deletions aspnetcore/blazor/state-management.md
Original file line number Diff line number Diff line change
Expand Up @@ -269,10 +269,16 @@ One way to resolve the error is to disable prerendering. This is usually the bes

:::moniker range=">= aspnetcore-8.0"

To disable prerendering, pass `false` to a server render mode attribute placed in the `Routes` component (`Routes.razor`):
To disable prerendering, indicate the render mode with the `prerender` parameter set to `false` at the highest-level component in the app's component hierarchy that isn't a root component (root components can't be interactive). Typically, this is where the `Routes` component is used in the `App` component (`Components/App.razor`) for apps based on the Blazor Web App project template:

```razor
<Routes @rendermode="@(new ServerRenderMode(prerender: false))" />
```
@attribute [RenderModeServer(false)]

Also, disable prerendering for the `HeadOutlet` component:

```razor
<HeadOutlet @rendermode="@(new ServerRenderMode(prerender: false))" />
```

:::moniker-end
Expand Down