Activity Forums Salesforce® Discussions How to use decorators( wire, track, api) in Lightning Web Component?

  • How to use decorators( wire, track, api) in Lightning Web Component?

    Posted by Shweta on December 17, 2020 at 3:25 pm

    How to use decorators( wire, track, api) in Lightning Web Component?

    Aditya replied 4 years ago 2 Members · 1 Reply
  • 1 Reply
  • Aditya

    Member
    December 17, 2020 at 6:29 pm

    @api: Marks a field as public. Public properties define the API for a component. An owner component that uses the component in its HTML markup can access the component’s public properties. All public properties are reactive, which means that the framework observes the property for changes. When the property’s value changes, the framework reacts and rerenders the component.@track: Tells the framework to observe changes to the properties of an object or to the elements of an array. If a change occurs, the framework rerenders the component. All fields are reactive. If the value of a field changes and the field is used in a template—or in the getter of a property used in a template—the framework rerenders the component. You don’t need to decorate the field`
    `.

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos