Error: Dynamic root HTML element id attribute - marko-js/marko GitHub Wiki
The id
for the outermost HTML element of a component must be static. Components are uniquely identified by their id
; if that id
changes during a re-render, then diffing and patching will break.
$ var id = input.id;
<div id=id/>
$ var id = input.id;
<div>
<div id=id/>
</div>
If you don’t care about the exact value of the id
, you can also have Marko generate one for you with id:scoped
:
<div id:scoped=""/>