Giter VIP home page Giter VIP logo

timerrepro's Introduction

TimerRepro

.NET 8 Blazor components unexpected behaviour

Entry point

  • Two the same interactive components placed in the same place on two different static pages

Observed behaviour

  • The same component instance is render on both pages
timer.mp4

Expected behaviour

  • Two different instances are rendered
timer_expected.mp4

Possible workarounds

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

Why is this an issue

  • Documentation doesn't have a word about such behaviour
  • Hidden dependency between pages
    Let's assume new static page was added to project.
    @page "/newPage"
    <TimerExample @rendermode=InteractiveServer/>
    @*
    Some stuff
    *@
    You can't determine what's gonna happen when you navigate to this page without knowledge about other pages because:
    • 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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.