Skip to content

Commit b79fd50

Browse files
authored
Update performance.md
1 parent 24bc6f9 commit b79fd50

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

aspnetcore/blazor/performance.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ At runtime, components exist in a hierarchy. A root component (the first compone
3333

3434
The last two steps of the preceding sequence continue recursively down the component hierarchy. In many cases, the entire subtree is rerendered. Events targeting high-level components can cause expensive rerendering because every component below the high-level component must rerender.
3535

36-
:::moniker range=">= aspnetcore-9.0"
37-
3836
To prevent rendering recursion into a particular subtree, use either of the following approaches:
3937

38+
:::moniker range=">= aspnetcore-9.0"
39+
4040
* Ensure that the set parameters of child components are of primitive immutable types, such as `string`, `int`, `bool`, `DateTime`, and other similar types. The built-in logic for detecting changes automatically skips rerendering if the primitive immutable parameter values haven't changed. Only the parameters that are explicitly set on the component are considered for change detection. If you render a child component with `<Customer CustomerId="item.CustomerId" />`, where `CustomerId` is an `int` type, then the `Customer` component isn't rerendered unless `item.CustomerId` changes.
4141
* Override <xref:Microsoft.AspNetCore.Components.ComponentBase.ShouldRender%2A>:
4242
* To accept nonprimitive parameter values, such as complex custom model types or <xref:Microsoft.AspNetCore.Components.RenderFragment> values.
@@ -46,8 +46,6 @@ To prevent rendering recursion into a particular subtree, use either of the foll
4646

4747
:::moniker range="< aspnetcore-9.0"
4848

49-
To prevent rendering recursion into a particular subtree, use either of the following approaches:
50-
5149
* Ensure that the set parameters of child components are of primitive immutable types, such as `string`, `int`, `bool`, `DateTime`, and other similar types. The built-in logic for detecting changes automatically skips rerendering if the primitive immutable parameter values haven't changed. Only the parameters that are explicitly set on the component are considered for change detection. If you render a child component with `<Customer CustomerId="item.CustomerId" />`, where `CustomerId` is an `int` type, then the `Customer` component isn't rerendered unless `item.CustomerId` changes.
5250
* Override <xref:Microsoft.AspNetCore.Components.ComponentBase.ShouldRender%2A>:
5351
* To accept nonprimitive parameter values, such as complex custom model types, event callbacks, or <xref:Microsoft.AspNetCore.Components.RenderFragment> values.

0 commit comments

Comments
 (0)