From https://www.polymer-project.org/1.0/docs/api/dom-if
When if becomes falsey, the stamped content is hidden but not removed from dom. When if subsequently becomes truthy again, the content is simply re-shown. This approach is used due to its favorable performance characteristics: the expense of creating template content is paid only once and lazily.
I thought this was the behavior of hidden
attribute, thus hidden
being cheaper than dom-if
since the template would not get restamped with hidden
. Since 'no restamp' is the default behavior dom-if
, what is the difference between dom-if
and hidden
and how is hidden
better for performance? Polymer best practices notes that hidden
is cheaper.