Skip to main content
3 réponses
  1. 13 janv. 2023, 14:29

    Hi @Dnyaneshwar Chaudhari

    The connectedCallback() method in Salesforce Lightning Web Components (LWC) is a synchronous operation.

    It is a lifecycle method that is called after the component is connected to the DOM, and it can be used to set up any initial state or perform any setup that is required before the component is rendered. Since it is synchronous, the component is not rendered until the connectedCallback() method has completed, so you should avoid performing any long-running or asynchronous operations in this method.

    If you need to perform asynchronous operations or access external data, you should use the renderedCallback() method or the @wire decorator. These methods are designed for updating the component's state based on changes to the data or state of other components, and they are called after the component has been rendered.

     

    https://corp.infogen-labs.com/imgs/salesforce/How_to_wait_for_long-running-operation_in_JS_LWC.pdf

0/9000