PDI · Question #56
Which three Salesforce resources can be accessed from a Lightning web component? Choose 3 answers
The correct answer is A. SVG resources D. Static resources E. All external libraries. Lightning Web Components can directly access SVG assets, files stored as Static Resources within Salesforce, and integrate various external JavaScript and CSS libraries.
Question
Which three Salesforce resources can be accessed from a Lightning web component? Choose 3 answers
Options
- ASVG resources
- BThird-party web components
- CContent asset files
- DStatic resources
- EAll external libraries
How the community answered
(24 responses)- A92% (22)
- B4% (1)
- C4% (1)
Why each option
Lightning Web Components can directly access SVG assets, files stored as Static Resources within Salesforce, and integrate various external JavaScript and CSS libraries.
SVG resources can be imported and used within Lightning Web Components, either as part of the component bundle or from static resources, enabling dynamic icon and graphic display.
While Lightning Web Components can embed or interact with third-party web components, these external components themselves are generally not considered "Salesforce resources" in the same way that static resources or content assets are.
Content asset files (Salesforce Files) can be referenced by URL or sometimes wrapped as static resources, but they are not typically accessed via a direct import mechanism analogous to static resources for general component assets.
Static resources, which include JavaScript files, CSS stylesheets, and images uploaded to Salesforce, are a fundamental way to bundle and serve assets to Lightning web components.
Lightning Web Components can access and utilize external libraries, typically by importing them from Salesforce static resources or by referencing them from external Content Delivery Networks (CDNs) if allowed by CORS policies.
Concept tested: LWC resource access
Source: https://developer.salesforce.com/docs/component-library/documentation/en/lwc/lwc.create_static_resources
Topics
Community Discussion
No community discussion yet for this question.