Migrate Initializers

Replace an init event handler in an Aura component with the standard JavaScript connectedCallback() method in a Lightning web component.

We use the init event in an Aura component to initialize a component after component construction but before rendering.

The doInit function in the component's controller performs any necessary initialization.

In a Lightning web component, use connectedCallback() instead in the component's JavaScript file.

See Also