Skip to content

Tag: D3

Lightning Web Components (LWC) Lifecycle Hooks and Using third-party JavaScript libraries

Lightning Web Components (LWC) Lifecycle Hooks and Using third-party JavaScript libraries Reference:https://developer.salesforce.com/docs/component-library/documentation/en/lwc/create_lifecycle_hooks Sometimes we get uses cases where we need to use third-party JavaScript libraries such as C3 (https://c3js.org/), I will go through the steps needed to configure this below using a use case: Download latest C3 libraries that include .js and .css files Download latest D3 libraries that include .js files. Create static resources for each of these in Salesforce. Create LWC component that uses these to render graphs from C3. LWC provides following lifecycle Hooks constructor() :This method… Read more Lightning Web Components (LWC) Lifecycle Hooks and Using third-party JavaScript libraries