Salesforce Fact #649 | LWC template refs in action
With the Spring'23 release, LWC template refs are available now. In order to use this in LWC, we need to enable Lightning Web Security first using the below step:
Setup -> Session Settings -> Under the section 'Lightning Web Security' select the checkbox for enabling LWS for LWC.
After this, we can use lwc:ref in our code. In this example, we have a textinput and we are getting the label and value using template refs when the input is getting changed.
Attached are the screenshots.
Comments
Post a Comment