StateHasChanged() vs InvokeAsync(StateHasChanged) in Blazor
问题 I know that calling the StateHasChanged() method notifies the component that the state has changed and that it should re-render. However, I also see calls to await InvokeAsync(StateHasChanged) or await InvokeAsync(() => StateHasChanged()) in other people's code, but I don't quite understand how it compares to StateHasChanged() and when should one be favored over the other, and why . The only information I could find was this part of the Blazor docs, it says: In the event a component must be