You need to sign in to do that
Don't have an account?
Navin Ganeshan 10
LWC: connectedCallback vs. @wire
All,
I am new LWC and documentations have been immensly useful to get me started on this journey. However, while looking at various examples on getting data from objects, i see examples randomly using @wire at someplace and connectedCallback at others.
question for this group is:
Navin
I am new LWC and documentations have been immensly useful to get me started on this journey. However, while looking at various examples on getting data from objects, i see examples randomly using @wire at someplace and connectedCallback at others.
question for this group is:
- what is the basic difference between these 2
- which situation would call for choosing between these 2 methods
- @wire does not fire sometime (i mean no calls to the apex method at all)
Navin
I found the below article regarding the @wire decorator and connectedCallback().
Can you please have a look at it once.
>> https://www.salesforcecodecrack.com/2019/01/wire-service-in-lightning-web.html
>> https://salesforcediaries.com/2019/12/13/connectedcallback-in-lightning-web-component/
I hope this helps and in case if this comes handy can you please choose this as best answer so that it can be used by others in the future.
Regards,
Anutej