QuestionQ29

VerifiedBasic Lightning Web Component Development

A developer is creating a custom Lightning web components (LWC) component that must retrieve data from an API. Which lifecycle hook should the developer use to make the API request?

Explanation

connectedCallback() runs when the component is inserted into the DOM and is intended for initialization work, including fetching data. Async work should be initiated there through a separate async method.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!