Skip to main content

Clayton Rules - Direct DOM manipulation in Lightning Web Components (LWC)

David Martin avatar
Written by David Martin
Updated yesterday

Rationale

Lightning Web Components use Shadow DOM to protect the component from being manipulated by arbitrary HTML, CSS, and JavaScript. Bypassing the Shadow DOM gives developers greater control, but is strongly discouraged as it significantly increases the risk of Cross-Site Scripting (XSS) and code injection.

Did this answer your question?