Does ctx.root point to the component or the document root?
Edwin Paul
2 months ago
Sep 25, 2026, 11:43 AM
Hey, does ctx.root.querySelector search within the component itself or from the document root? I usually generate dynamic IDs, but I’m hoping there’s a cleaner way.
Jacob Kofoed
2 months ago
Sep 25, 2026, 11:45 AM
It searches from the document root. The only difference from using document.querySelector is if the component is being used as a web-component, in which case ctx.root would return the ShadowRoot.