When a component instance is created, the constructor() method is called. Avoid adding properties to the host element while it is being built. In any other lifecycle hook, you can…
Tag: Lightning web components

Content Asset Files in Salesforce LWC
As a continuation of learning about Lightning Web Components, today we will be discussing content asset files in LWC. We can import content asset files from the scoped module @salesforce/contentAssetUrl. To…

Static Resources in LWC
In Salesforce, you can import static resources from the scoped module @salesforce/resourceUrl. Static resources in LWCs include images, style sheets, JavaScript, and archives (like.zip and.jar files). import myWgResource from ‘@salesforce/resourceUrl/resourceWgReference’;…

Working with LWC and Aura
In Salesforce, new Lightning web components (LWCs) can be created and added to projects that already contain Aura components. Alternatively, you can migrate incrementally according to your plan by swapping…

Putting Components Together
To make the code more reusable and maintainable, it is helpful to assemble apps and components using a container and a collection of smaller components. You can use the various…

Testing Lightning Web Components
Today, we are going to review how to test Lightning Web Components (LWCs) with jest tests. First, create local JavaScript files for your component tests. Together with the component itself,…