You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: aspnetcore/blazor/performance/rendering.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,8 +29,8 @@ The last two steps of the preceding sequence continue recursively down the compo
29
29
To prevent rendering recursion into a particular subtree, use either of the following approaches:
30
30
31
31
* Ensure that child component parameters are of specific immutable types†, 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†, such as complex custom model types or <xref:Microsoft.AspNetCore.Components.RenderFragment> values.
* When parameters are nonprimitive types or unsupported immutable types†, such as complex custom model types or <xref:Microsoft.AspNetCore.Components.RenderFragment> values, and the parameter values haven't changed,
34
34
* If authoring a UI-only component that doesn't change after the initial render, regardless of parameter value changes.
35
35
36
36
†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