Skip to content

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Jul 21, 2025

Backport of #62824 to release/10.0-preview7

/cc @javiercn

[Blazor] Support persisting component state on enhanced navigation

Adds support for restoring data from persistent component state during enhanced navigation requests.

Description

Currently, the persistent state only works during the initial render of components for a given runtime. This limitation exists because the system doesn't recognize enhanced navigations and lacks a mechanism to update the state of already running components.

This fix adds a mechanism to opt-in to receive state updates from enhanced navigations coming from the server to running Blazor server and webassembly runtimes.

Fixes #51584

Customer Impact

Customers experience inconsistent behavior and confusion when using PersistentComponentState with Blazor’s enhanced navigation.

They encounter bugs such as double database queries and unpredictable initialization, leading to degraded user experience—especially flickering and repeated API calls instead of preserved state.

Workarounds require extra boilerplate, increase page size, and do not scale well for complex scenarios. Some developers avoid enhanced navigation or restructure their applications in less optimal ways to mitigate these issues.

Regression?

  • Yes
  • No

Risk

  • High
  • Medium
  • Low

[Justify the selection above]

Verification

  • Manual (required)
  • Automated

Packaging changes reviewed?

  • Yes
  • No
  • N/A
* Adds support for ignoring persisted values during prerendering * Adds support for ignoring persisted values during resume * Adds support for receiving value updates during enhanced navigation Fixes #51584
@javiercn javiercn force-pushed the backport/pr-62824-to-release/10.0-preview7 branch from aee9e43 to 92027d2 Compare July 21, 2025 22:51
@dotnet-policy-service dotnet-policy-service bot added the pending-ci-rerun When assigned to a PR indicates that the CI checks should be rerun label Jul 29, 2025
@lewing lewing closed this Aug 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pending-ci-rerun When assigned to a PR indicates that the CI checks should be rerun

2 participants