-
Notifications
You must be signed in to change notification settings - Fork 25.1k
Description
Description
Steps to reproduce
- Make a new template
dotnet new blazor - add
@rendermode InteractiveServerto the weather page - Start the app
- Go to /weather
1 Observe the double rendering in action. - Add in code from https://learn.microsoft.com/en-us/aspnet/core/blazor/components/prerender?view=aspnetcore-9.0 to use PersistingComponentStateSubscription to save data
- Restart the app
- Navigate back and forth using the navigation links on the left hand side. (between home and weather and counter). Most times the double rendering still occurs on the weather page, sometimes it does not.
- Navigate to /home via the link on the left.
- Manually type in /weather into the url
- Double rendering never occurs when manually typing in the url
Questions
Why does the persisting only work sometimes?
The page has the following note If the app adopts interactive routing and the page is reached via an internal navigation, prerendering doesn't occur. Therefore, you must perform a full page reload for the PrerenderedCounter2 component to see the following output.
This doesn't make sense. Using internal navigation, prerendering is still occuring, and persisting is NOT working to stop it. Is this note out of date?
Are there changes in dotnet 9 to how the PersistingComponentStateSubscription works? or how pre-rendering works?
Not sure if this needs to be a bug report in another repo, or if this is just a documentation issue.
Page URL
https://learn.microsoft.com/en-us/aspnet/core/blazor/components/prerender?view=aspnetcore-9.0
Content source URL
https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/blazor/components/prerender.md
Document ID
ffdc8df3-55a8-b757-d4e6-38c104916002
Article author
Metadata
Metadata
Assignees
Labels
Type
Projects
Status