Skip to content

Commit 0a6414b

Browse files
authored
[Blazor] Handle Errors - CascadingValue to include IsFixed attribute (#36231)
1 parent 61a3eba commit 0a6414b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

aspnetcore/blazor/fundamentals/handle-errors.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@ The following `ProcessError` component example merely logs errors, but methods o
532532
```razor
533533
@inject ILogger<ProcessError> Logger
534534
535-
<CascadingValue Value="this">
535+
<CascadingValue Value="this" IsFixed="true">
536536
@ChildContent
537537
</CascadingValue>
538538
@@ -555,6 +555,8 @@ The following `ProcessError` component example merely logs errors, but methods o
555555

556556
> [!NOTE]
557557
> For more information on <xref:Microsoft.AspNetCore.Components.RenderFragment>, see <xref:blazor/components/index#child-content-render-fragments>.
558+
>
559+
> <xref:Microsoft.AspNetCore.Components.CascadingValue%601.IsFixed%2A?displayProperty=nameWithType> is used to indicate that a cascading parameter doesn't change after initialization.
558560
559561
:::moniker-end
560562

@@ -648,7 +650,7 @@ The following `ProcessError` component passes itself as a [`CascadingValue`](xre
648650
@using Microsoft.Extensions.Logging
649651
@inject ILogger<ProcessError> Logger
650652
651-
<CascadingValue Value="this">
653+
<CascadingValue Value="this" IsFixed="true">
652654
@ChildContent
653655
</CascadingValue>
654656
@@ -666,6 +668,8 @@ The following `ProcessError` component passes itself as a [`CascadingValue`](xre
666668

667669
> [!NOTE]
668670
> For more information on <xref:Microsoft.AspNetCore.Components.RenderFragment>, see <xref:blazor/components/index#child-content-render-fragments>.
671+
>
672+
> <xref:Microsoft.AspNetCore.Components.CascadingValue%601.IsFixed%2A?displayProperty=nameWithType> is used to indicate that a cascading parameter doesn't change after initialization.
669673
670674
In the `App` component, wrap the <xref:Microsoft.AspNetCore.Components.Routing.Router> component with the `ProcessError` component. This permits the `ProcessError` component to cascade down to any component of the app where the `ProcessError` component is received as a [`CascadingParameter`](xref:blazor/components/cascading-values-and-parameters#cascadingparameter-attribute).
671675

0 commit comments

Comments
 (0)