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 3 years, 3 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

Popular Salesforce Videos