Skip to content

Commit 4003f8c

Browse files
authored
Cover RenderFragment caching behavior (#36087)
1 parent 0260e26 commit 4003f8c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

aspnetcore/blazor/components/sections.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: Learn how to control the content in a Razor component from a child
55
monikerRange: '>= aspnetcore-8.0'
66
ms.author: wpickett
77
ms.custom: mvc
8-
ms.date: 11/12/2024
8+
ms.date: 09/10/2025
99
uid: blazor/components/sections
1010
---
1111
# ASP.NET Core Blazor sections
@@ -85,6 +85,10 @@ When the `Counter` component is accessed, the `MainLayout` component renders the
8585
> [!NOTE]
8686
> <xref:Microsoft.AspNetCore.Components.Sections.SectionOutlet> and <xref:Microsoft.AspNetCore.Components.Sections.SectionContent> components can only set either <xref:Microsoft.AspNetCore.Components.Sections.SectionOutlet.SectionId%2A> or <xref:Microsoft.AspNetCore.Components.Sections.SectionOutlet.SectionName%2A>, not both.
8787
88+
## `RenderFragment` caching rules and section rendering behavior
89+
90+
When a <xref:Microsoft.AspNetCore.Components.Sections.SectionContent>'s <xref:Microsoft.AspNetCore.Components.RenderFragment> content changes, which is a different instance than the component where it's rendered, Blazor completely destroys and recreates the section instead of attempting to update the section's content. Unlike normal rendering, the section's content could come from different instances, and it doesn't make sense to attempt processing content from two separate components, which might lead to unexpected results. For a detailed explanation on this behavior, see [Inconsistent component initialization with Blazor SectionOutlet/SectionContent and CascadingValue (`dotnet/aspnetcore` #58316)](https://github.com/dotnet/aspnetcore/issues/58316).
91+
8892
## Section interaction with other Blazor features
8993

9094
A section interacts with other Blazor features in the following ways:

0 commit comments

Comments
 (0)