.NET 8 Blazor components unexpected behaviour
- Two the same interactive components placed in the same place on two different static pages
- The same component instance is render on both pages
timer.mp4
- Two different instances are rendered
timer_expected.mp4
- Using @key attribute directly on components
- Adding empty component before interactive one on either counter or home page.
- Using InteractiveMode directly on page
- Documentation doesn't have a word about such behaviour
- Hidden dependency between pages
Let's assume new static page was added to project.You can't determine what's gonna happen when you navigate to this page without knowledge about other pages because:@page "/newPage" <TimerExample @rendermode=InteractiveServer/> @* Some stuff *@
- If there is other page with matching layout until 'Some stuff' then when navigating only between these 2, the timer would be the same.
- If there is no page with matching layout, then new component will be rendered no matter from which page you come to this page