Migrate Attributes

Migrate attributes from <aura:attribute> tags in an Aura component to JavaScript properties in a Lightning web component.

Let’s look at a myAttribute attribute in an Aura component.

In a Lightning web component, we use a JavaScript property called myAttribute instead.

The @api decorator defines myAttribute as a public property. See Public Properties.

Reference the property in the component’s HTML file.

Boolean attribute values in Lightning web components are set in markup without indicating true and false values. The value is set by the attribute’s presence (true) or absence (false). In JavaScript, boolean property values can be set with dynamic computed values. If a boolean property’s value computes to false, it is removed from the DOM. See Boolean Properties.

A Lightning web component must fully support the converted Aura component’s attributes. If it doesn’t, expect errors and breakages.

See Also