Now you can use refs to access elements in LWC.
Key points
1) You can get the reference of DOM Element using this.refs
2) If the template contains duplicate lwc:ref directives, this.refs references the last directive.
3) It is performance efficient over querySelector because Refs locate DOM elements without a selector and only query elements contained in a specified template.
Spring'23 Org Signup
https://www.salesforce.com//form/signup/prerelease-spring23/
#salesforce #lwc #spring2023 #latestnews #ohana #salesforcerelease
Download
0 formats
No download links available.
lwc:ref directive - Query any DOM element | Lightning Web Components | Spring'23 | NatokHD