Salesforce Fact #536 | Current component name in LWC

We can get the current component name in same LWC using the syntax: this.template.host.localName. It returns the component name in the format: <namespace>-<componentName> considering the Kebab case.

Reference: https://salesforce.stackexchange.com/questions/326166/can-an-lwc-component-get-its-own-name

Comments

Popular posts from this blog

Salesforce Fact #192 | Call batch apex from flow

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