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.

Reference: https://developer.salesforce.com/docs/component-library/documentation/en/lwc/lwc.reference_directives

Attached are the screenshots.





 

Comments

Popular posts from this blog

Salesforce Fact #192 | Call batch apex from flow

Salesforce Fact #457 | Get current user role name in flow