From 8631144f0e129202d2861d1ff5a693cdb403ef1e Mon Sep 17 00:00:00 2001 From: Robert Haken Date: Thu, 28 Nov 2024 02:17:17 +0100 Subject: [PATCH 1/3] [Blazor] State management - StateHasChanged+InvokeAsync --- aspnetcore/blazor/state-management.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aspnetcore/blazor/state-management.md b/aspnetcore/blazor/state-management.md index 2a80d762bed7..4003e666cd82 100644 --- a/aspnetcore/blazor/state-management.md +++ b/aspnetcore/blazor/state-management.md @@ -791,7 +791,7 @@ When implementing custom state storage, a useful approach is to adopt [cascading ## Troubleshoot -In a custom state management service, a callback invoked outside of Blazor's synchronization context must wrap the logic of the callback in to move it onto the renderer's synchronization context. +When using a custom state management service, if you want to support state modifications from outside Blazor's synchronization context (for example from a timer or a background service), all consuming components must wrap the `StateHasChanged` call in . This ensures the change notification is handled on the renderer's synchronization context. When the state management service doesn't call on Blazor's synchronization context, the following error is thrown: From 8d24a7da0f1a8dca7ff9329bbcd5c0e144c97d33 Mon Sep 17 00:00:00 2001 From: Luke Latham <1622880+guardrex@users.noreply.github.com> Date: Sun, 1 Dec 2024 15:46:56 -0500 Subject: [PATCH 2/3] Update aspnetcore/blazor/state-management.md --- aspnetcore/blazor/state-management.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aspnetcore/blazor/state-management.md b/aspnetcore/blazor/state-management.md index 4003e666cd82..eccf551ae44e 100644 --- a/aspnetcore/blazor/state-management.md +++ b/aspnetcore/blazor/state-management.md @@ -791,7 +791,7 @@ When implementing custom state storage, a useful approach is to adopt [cascading ## Troubleshoot -When using a custom state management service, if you want to support state modifications from outside Blazor's synchronization context (for example from a timer or a background service), all consuming components must wrap the `StateHasChanged` call in . This ensures the change notification is handled on the renderer's synchronization context. +When using a custom state management service where you want to support state modifications from outside Blazor's synchronization context (for example from a timer or a background service), all consuming components must wrap the `StateHasChanged` call in . This ensures the change notification is handled on the renderer's synchronization context. When the state management service doesn't call on Blazor's synchronization context, the following error is thrown: From e53ac22800db1f532ccf6d29cbe4fb5ee6c0ba56 Mon Sep 17 00:00:00 2001 From: Luke Latham <1622880+guardrex@users.noreply.github.com> Date: Thu, 12 Dec 2024 05:25:12 -0500 Subject: [PATCH 3/3] Update aspnetcore/blazor/state-management.md --- aspnetcore/blazor/state-management.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aspnetcore/blazor/state-management.md b/aspnetcore/blazor/state-management.md index eccf551ae44e..c7734f37e2b0 100644 --- a/aspnetcore/blazor/state-management.md +++ b/aspnetcore/blazor/state-management.md @@ -791,7 +791,7 @@ When implementing custom state storage, a useful approach is to adopt [cascading ## Troubleshoot -When using a custom state management service where you want to support state modifications from outside Blazor's synchronization context (for example from a timer or a background service), all consuming components must wrap the `StateHasChanged` call in . This ensures the change notification is handled on the renderer's synchronization context. +When using a custom state management service where you want to support state modifications from outside Blazor's synchronization context (for example from a timer or a background service), all consuming components must wrap the call in . This ensures the change notification is handled on the renderer's synchronization context. When the state management service doesn't call on Blazor's synchronization context, the following error is thrown: