Activity Forums Salesforce® Discussions What is connectedCallBack in LWC?

  • Anjali

    Member
    December 17, 2020 at 2:33 pm

    This is one of life cycle hook in web component JavaScript. connectedCallBack function invokes/fires automatically when certain lwc component inserted into web dom. It is works like init handler in lightning aura component, we can say it is lwc init handler.

  • Shweta

    Member
    December 18, 2020 at 2:43 pm

    connectedCallback(): This callback method called when the element is inserted into a document. Its lifecycle flows from Parent to Child Component. we can’t access child elements in the component body because they don’t exist yet. You can access the host element with this.template.

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos