Lifecycle Hooks

A lifecycle hook is a callback method that triggers at a specific phase of a component instance’s lifecycle. With LWC, you can use the following lifecycle hooks.

Lightning web components have a lifecycle managed by the framework. The framework creates components, inserts them into the DOM, renders them, and removes them from the DOM. It also monitors components for property changes.

This diagram shows the flow of the component lifecycle from creation through render.

Shows the lifecycle flow of a component instance from creation through renderedCallback.

This diagram shows what happens when a component instance is removed from the DOM.

Shows lifecycle for the disconnectedCallback.