Skip to content

Commit d6c50cb

Browse files
authored
[Blazor] rendering perf - ShouldRender nits (#35495)
1 parent 936edad commit d6c50cb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

aspnetcore/blazor/performance/rendering.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ The last two steps of the preceding sequence continue recursively down the compo
2929
To prevent rendering recursion into a particular subtree, use either of the following approaches:
3030

3131
* Ensure that child component parameters are of specific immutable types&dagger;, such as `string`, `int`, `bool`, and `DateTime`. The built-in logic for detecting changes automatically skips rerendering if the immutable parameter values haven't changed. 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.
32-
* Override [`ShouldRender`](xref:blazor/components/rendering#suppress-ui-refreshing-shouldrender), setting it to `false`:
33-
* When parameters are nonprimitive types or unsupported immutable types&dagger;, such as complex custom model types or <xref:Microsoft.AspNetCore.Components.RenderFragment> values.
32+
* Override [`ShouldRender`](xref:blazor/components/rendering#suppress-ui-refreshing-shouldrender), returning `false`:
33+
* When parameters are nonprimitive types or unsupported immutable types&dagger;, such as complex custom model types or <xref:Microsoft.AspNetCore.Components.RenderFragment> values, and the parameter values haven't changed,
3434
* If authoring a UI-only component that doesn't change after the initial render, regardless of parameter value changes.
3535

3636
&dagger;For more information, see [the change detection logic in Blazor's reference source (`ChangeDetection.cs`)](https://github.com/dotnet/aspnetcore/blob/main/src/Components/Components/src/ChangeDetection.cs).

0 commit comments

Comments
 (0)