The Salesforce Developers website will undergo maintenance on May 29, 2024 from 3:00 a.m. UTC to 10:00 a.m. UTC. The maintenance process may affect the availability of our documentation. Please plan accordingly.

Migrate Iterations

Migrate <aura:iteration> tags in an Aura component to for:each in a Lightning web component.

Here’s the Aura syntax.

Here’s the Lightning web component syntax.

Note that you must use a key to assign a unique value to each item in the list. See Render Lists.

You can’t initialize list options in a Lightning web component template like you can in Aura component markup. You must initialize list options in JavaScript. See the lightning-dual-listbox component for an example.