Skip to content

[release/10.0-preview7] [Blazor] Support persisting component state on enhanced navigation #62846

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: release/10.0-preview7
Choose a base branch
from

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant