Skip to content

Error: Dynamic root HTML element id attribute

Austin Kelleher edited this page May 31, 2017 · 2 revisions

The ID for the root HTML element of a UI component must be static. UI components are uniquely identified by the ID and if the ID changes during a re-render, then diffing/patching will not break.

Results in an error:

$ var id = input.id;

<div id=id/>

Wrapping in a <div> will resolve the issue:

$ var id = input.id;

<div>
  <div id=id/>
</div>
Clone this wiki locally