Skip to content

[Blazor .NET 8] The same component instance rendered in different pages when using interactive mode #52102

@gaplin

Description

@gaplin

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

When on a static page I include interactive component in the same place then when moving from one page to the other, the same instance is rendered.
I've included simple repro including timer component.
Here is a video showing current behaviour (counter value should be reset between pages):

timer.mp4

Problem is solved either by:

  • Using @key attribute directly on components
  • Adding empty component before interactive one on either counter or home page.
  • Using InteractiveMode directly on page

I think it might be related to this open issue #51073

Expected Behavior

Rendered instances are different

Steps To Reproduce

  1. Clone https://github.com/gaplin/TimerRepro
  2. Run the app
  3. Move between pages using nav menu

Exceptions (if any)

No response

.NET Version

8.0.100

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-blazorIncludes: Blazor, Razor ComponentsenhancementThis issue represents an ask for new feature or an enhancement to an existing one

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions