Activity Forums Salesforce® Discussions What is the use of decorators in LWC in Salesforce?

  • Marziya

    Member
    December 10, 2020 at 2:43 pm

    Decorators dynamically alter the functionality of a property or function. The ability to create decorators is part of ECMAScript, but these three decorators are unique to Lightning Web Components. @api: To expose a public property, decorate it with @api. Public properties define the API for a component.

  • Shweta

    Member
    December 24, 2020 at 5:22 pm

    Decorator is a part of ECMA script and used to add extra functionality in your function or methods. In LWC we use 3 decorator to enhance the functionality of our property or function.
    These are the three decorators of LWC: @api, @wire, and @track.

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos