1

Is it possible to use third-party standard Web Components with Lightning Web Components? I have seen the documentation about third-party libraries. But what about web components? Has anyone tried to integrate those into your own Lightning Web Components?

  • Do you mean using react in LWC? – Pranay Jaiswal Mar 26 at 17:58
  • Not React, Web Components. E.g. there's a growing repository of these: webcomponents.org and many more published through npm. And I can't wrap my head around integrating them with LWC. First, they are usually published as ES6 modules, with a lot of dependencies, so I can't import them from Static Resources (or can I?). – Pawel Fronczak Mar 26 at 21:16
3

It's impossible to use standard web components in LWC nor in Aura. The customElement.defines API to define a native custom element is currently blocked by Locker because of the security implications this API has.

  • That's a pity. But thank you for confirming this. But I imagine we can still build a web component application and place it inside an Aura lightning:container? – Pawel Fronczak Mar 27 at 12:03
  • 1
    Locker doesn't run in ligthning:container so native web components should work as expected. – pmdartus Mar 27 at 16:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.