firing a method in Lightning web component from Parent Aura Component

In lightning web component, We can fire a method defined in child lightning web component from parent lightning web component. What if a lightning web component is called in parent aura component? How to fire a method in Lightning web component from aura component where aura component is the parent?

The answers is yes. You can fire a method in Lightning web component from parent aura component by assigning an aura:id while calling the component.

Define a method on Lightning Web Component

Let’s create a lightning web component named childLwc and define a method in its js file. The component bundle in Lightning web component has three file:-

  • childLwc.html
  • childLwc.js
  • childLwc.js-meta.xml


The html file does have a property named number to show the value defined from js method.

  The number is:- {number}


The js file has one public reactive property and one public method annonated with @api. When you annonate a method with @api, you can fire the method from another aura component or lightning web component where this component has been called.

Whenever the method gets fired, we are changing the value of public property which is reactive in nature. Whenever the reactive property changes its value, the rerender happens and your screen shows the latest value.

import { LightningElement, api } from "lwc";

export default class ChildLwc extends LightningElement {
  @api number = 1000;
  getFiredFromAura() {
    if (this.number === 0) {
      this.number = 1000;
    } else {
      this.number = 0;


As we will call this component to another parent aura component, we don’t need to expose it.

<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="" fqn="childLwc">

Call the Lightning web component inside parent Aura component

We will create an aura component named HostLwc which uses the child lightning web component in its component markup. We need to assign an aura:id to access the lightning web component from aura component. We also have a lightning button which will invoke the lightning web component method.


<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" access="global" >
        <div class="slds-box">
           <c:childLwc aura:id="childlwc"/> <!--Aura id to access the LWC-->
        <lightning:button variant="brand" label="Fire Method on Child LWC" onclick="{!c.handleClick}"/>


The controller has method which invoke the lightning web component method from aura component method. We can access the LWC using ‘component.find(‘your aura id’)‘ and fire any public method defined in lwc using ‘component.find(‘ your aura id ‘).methodName();‘.

	handleClick : function(component, event, helper) {

Demo(Firing LWC method from Aura)

When you press the button, the number value gets changed. The method is written in lightning web component but we are invoking it through parent aura component.

To learn more about communication in Lightning web component, Keep checking this section:-


  1. Hello there,

    The example is not working.
    getFiredFromAura() is not recognized in the Aura controller. Can you give me some insight?


Leave a Reply