You need to sign in to do that
Don't have an account?

Call lwc method from aura parent after loading
I have an LWC with a public method @show(). This needs to fire on the lwc when it's parents aura component finishes loading.
I have tried doInit, all the render functions and none of them work.
I added a button on the aura parent and handleButtonClick handler - when clicking it fires the @show method and displays. This is not my ideal functionality.
I'm looking for a way to fire the @show method on the LWC child when the aura parent finishes loading. How do I do this?
this works great:
handleClick: function (component, event, helper) {
component.find('childlwc').show();
}
What i'm looking for is a way to call the show method on childlwc once the page finishes loading.
Thanks!
I have tried doInit, all the render functions and none of them work.
I added a button on the aura parent and handleButtonClick handler - when clicking it fires the @show method and displays. This is not my ideal functionality.
I'm looking for a way to fire the @show method on the LWC child when the aura parent finishes loading. How do I do this?
this works great:
handleClick: function (component, event, helper) {
component.find('childlwc').show();
}
What i'm looking for is a way to call the show method on childlwc once the page finishes loading.
Thanks!
You can use connectedCallback method in LWC to call your show method. connectedCallBack works like doInit menthod in aura.
Thanks,
Shubham