Skip to content

Deprecation: control flow attributes

Taylor Hunt edited this page Aug 2, 2019 · 3 revisions

The inline control flow attributes if, while, and for are deprecated in favor of their tag counterparts: <if>, <while>, and <for>.

Here’s an example of how to migrate (and hopefully illustrates why you should):

<img class="large-image placeholder" src="https://via.placeholder.com/350x150" aria-describedby="my-fancy-component" if(input.show) />

…now becomes:

<if(input.show)>
  <img class="large-image placeholder" src="https://via.placeholder.com/350x150" aria-describedby="my-fancy-component" />
</if>
You can’t perform that action at this time.