Activity › Forums › Salesforce® Discussions › What is the difference between constructor and connectedcallback in LWC?

  • What is the difference between constructor and connectedcallback in LWC?

    Posted by Shweta on December 24, 2020 at 5:17 PM

    What is the difference between constructor and connectedcallback in LWC?

    Anjali replied 5 years, 9 months ago 2 Members · 1 Reply
  • 1 Reply
  • Anjali

    Member
    December 29, 2020 at 9:17 AM

    constructor() is called when the element is created.
    connectedCallback() is called when (after) the element is attached to the DOM.

Log In to reply.

Popular Salesforce Blogs

Unlocking Success with Salesforce Sales Cloud: Implementation, Services, Features, and Support

Blog in

Salesforce Sales Cloud is a robust and comprehensive CRM solution designed to assist companies in managing their sales processes more efficiently. It offers a suite…

Popular Salesforce Videos