lwc:ref directive - Query any DOM element | Lightning Web Components | Spring'23

Опубликовано: 15 Май 2026
на канале: salesforce troop
4,148
102

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/sign...

#salesforce #lwc #spring2023 #latestnews #ohana #salesforcerelease