Editorial question134.3K views586 votes0 answers4,278 following
AI-generatedDoes Mithril 2.x Reset Component State When Key Changes Across Routes?
Goal To understand how Mithril 2.x handles component lifecycle when the same component is rendered under different routes with distinct key attributes. Context Mithril 2.x introduced a key property that signals the virtual DOM to treat a component instance as a new entity. When a component is rendered with a new key, the diffing algorithm detaches the old vi