Provide a simple opt-out option of preserving statically rendered components during navigation
- Dominant language
- C#
- Stars
- 38.4k
- Forks
- 10.9k
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 290
Description
### Is there an existing issue for this?
- [X] I have searched the existing issues
### Describe the bug
The problem is : when I refresh static page that contains interactive component then interactive component is not refreshed.
I've got an app :



When I click remove last button and refresh page using such code :
var absoluteUri = this.NavigationManager.ToAbsoluteUri(this.NavigationManager.Uri);
this.NavigationManager.NavigateTo(absoluteUri.AbsolutePath);
Then page is refreshed but interactive component not

If I provide a @key to my interactive component inside static one

Then all works as expected and interactive component is recreated and displayed

Here is link to repo https://github.com/IevgeniiKunshchykov/InteractivePageUpdateInsideStatic.git
Can someone explain me that behavior? Why is that done in such way? Why interactive component is not reinitialized without @key?
Thank you!
### Expected Behavior
Interactive component is reinitialized inside static one
### Steps To Reproduce
_No response_
### Exceptions (if any)
_No response_
### .NET Version
_No response_
### Anything else?
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.