You need to sign in to do that
Don't have an account?
Akhil Katkam 5
how to write aura : handler in lwc
Hi Developer Community,
I am currently working on a task and It requires LWC,
So my problem is , how can i write aura:handler method in LWC
for example:
<aura:handler name="init" value="{!this}" action="{!c.doInit}" />
This above example need to be written in LWC,
Can u please help me with this problem
Thanks in Advance
>> https://developer.salesforce.com/docs/component-library/documentation/en/lwc/migrate_initializers
As mentioned in the above link, you can use connected call back in lightning web components for using init equivalent in lwc.
Below is a snippet mentioned in documentation for quick reference:
>> https://salesforcediaries.com/2019/09/29/onload-in-lightning-web-component/
The above link has implementations for using connected callback in lwc.
Let me know if it helps you and close your query by marking it as solved so that it can help others in the future.
Thanks.
You can use connectedCallback() in LWC
Please go through below link you have idea how to use it
https://salesforcediaries.com/2020/04/30/onload-in-aura-vs-lightning-web-component/