---
schema_version: "1"
id: 2584a6bf46bf38306dd5d47ed7cd323dd483ab2f9fcfe20e672fd74ebc0037bd
title: Component
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/platform/aura-platform/guides/aura/ref-jsapi/ref-jsapi-component.md
canonical_url: https://developer.salesforce.com/docs/platform/aura-platform/guide/ref-jsapi-component.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 67b5c30d8a6b18b096914da17417e0dc5e72380bd6c6031296c9182e93e0d745
products:
  - Lightning Aura Components Developer Guide
  - Platform Developer Content
---

# Component

`Component` contains methods to work with components.

## Methods

-   **[addEventHandler()](https://developer.salesforce.com/docs/platform/aura-platform/guide/ref-jsapi-component-addeventhandler.md)**  


    Dynamically adds an event handler for a component or application event.

-   **[addHandler()](https://developer.salesforce.com/docs/platform/aura-platform/guide/ref-jsapi-component-addhandler.md)**  


    Deprecated. Use `addEventHandler()` instead.

-   **[addValueHandler()](https://developer.salesforce.com/docs/platform/aura-platform/guide/ref-jsapi-component-addvaluehandler.md)**  


    Adds handlers to values owned by the component.

-   **[addValueProvider()](https://developer.salesforce.com/docs/platform/aura-platform/guide/ref-jsapi-component-addvalueprovider.md)**  


    Adds custom value providers to a component.

-   **[autoDestroy()](https://developer.salesforce.com/docs/platform/aura-platform/guide/ref-jsapi-component-autodestroy.md)**  


    Sets a flag to tell the rendering service whether or not to destroy this component when it is removed from its rendering facet.

-   **[clearReference()](https://developer.salesforce.com/docs/platform/aura-platform/guide/ref-jsapi-component-clearreference.md)**  


    Clears a live reference for the value passed in using property syntax. For example, if you use `aura:set` to set a value and later want to reset the value using `component.set()`, clear the reference before resetting the value.

-   **[destroy()](https://developer.salesforce.com/docs/platform/aura-platform/guide/ref-jsapi-component-destroy.md)**  


    Destroys the component and cleans up memory. After a component that is declared in markup is no longer in use, the framework automatically destroys it and frees up its memory. If you create a component dynamically in JavaScript and that component isn't added to a facet (`v.body` or another attribute of type `Aura.Component[]`), you have to destroy it manually using `destroy()` to avoid memory leaks.

-   **[find()](https://developer.salesforce.com/docs/platform/aura-platform/guide/ref-jsapi-component-find.md)**  


    Locates a component using its local ID (`aura:id`).

-   **[get()](https://developer.salesforce.com/docs/platform/aura-platform/guide/ref-jsapi-component-get.md)**  


    Returns the value referenced using property syntax. For example, `cmp.get("v.attr")` returns the value of the `attr` attribute.

-   **[getConcreteComponent()](https://developer.salesforce.com/docs/platform/aura-platform/guide/ref-jsapi-component-getconcretecomponent.md)**  


    Gets the concrete implementation of a component. If the component is concrete, the method returns the component itself. For example, call this method to get the concrete component of a super component.

-   **[getElement()](https://developer.salesforce.com/docs/platform/aura-platform/guide/ref-jsapi-component-getelement.md)**  


    If the component renders only a single element, return it. Otherwise, use `getElements()`.

-   **[getElements()](https://developer.salesforce.com/docs/platform/aura-platform/guide/ref-jsapi-component-getelements.md)**  


    Returns a map of the elements rendered by the component.

-   **[getEvent()](https://developer.salesforce.com/docs/platform/aura-platform/guide/ref-jsapi-component-getevent.md)**  


    Returns a new event instance of the named component event.

-   **[getGlobalId()](https://developer.salesforce.com/docs/platform/aura-platform/guide/ref-jsapi-component-getglobalid.md)**  


    Gets the global ID, which is the generated globally unique id of the component. It can be used to locate the instance later, but will change across page loads.

-   **[getLocalId()](https://developer.salesforce.com/docs/platform/aura-platform/guide/ref-jsapi-component-getlocalid.md)**  


    Gets the ID set using the `aura:id` attribute. Pass the local ID into `find()` on the parent component to locate this child component.

-   **[getName()](https://developer.salesforce.com/docs/platform/aura-platform/guide/ref-jsapi-component-getname.md)**  


    Returns the component’s code-compatible camel case name, such as `'lightningButton'`.

-   **[getReference()](https://developer.salesforce.com/docs/platform/aura-platform/guide/ref-jsapi-component-getreference.md)**  


    Returns a live reference to the value indicated using property syntax. This method is useful when you dynamically create a component.

-   **[getSuper()](https://developer.salesforce.com/docs/platform/aura-platform/guide/ref-jsapi-component-getsuper.md)**  


    Returns the super component.

-   **[getType()](https://developer.salesforce.com/docs/platform/aura-platform/guide/ref-jsapi-component-gettype.md)**  


    Returns the component’s canonical type; for example, `'lightning:button'`.

-   **[getVersion()](https://developer.salesforce.com/docs/platform/aura-platform/guide/ref-jsapi-component-getversion.md)**  


    Returns the component’s version number.

-   **[isConcrete()](https://developer.salesforce.com/docs/platform/aura-platform/guide/ref-jsapi-component-isconcrete.md)**  


    Returns `true` if the component is concrete, or `false` otherwise. A concrete component is a sub-component in an inheritance chain.

-   **[isInstanceOf()](https://developer.salesforce.com/docs/platform/aura-platform/guide/ref-jsapi-component-isinstanceof.md)**  


    Checks whether a component is an instance of the given component or interface name.

-   **[isValid()](https://developer.salesforce.com/docs/platform/aura-platform/guide/ref-jsapi-component-isvalid.md)**  


    Returns `true` if the component has not been destroyed.

-   **[removeEventHandler()](https://developer.salesforce.com/docs/platform/aura-platform/guide/ref-jsapi-component-removeeventhandler.md)**  


    Dynamically removes a component event handler for the specified event.

-   **[set()](https://developer.salesforce.com/docs/platform/aura-platform/guide/ref-jsapi-component-set.md)**  


    Sets the value referenced using property syntax.


