function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
vamshi kothakapu 9vamshi kothakapu 9 

doInit is being called twice without any reason

AbhishekAbhishek (Salesforce Developers) 
Hi Vamsi,

The below blog answers your question,

https://salesforce.stackexchange.com/questions/165821/doinit-method-is-being-called-twice

I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.

Thanks.
vamshi kothakapu 9vamshi kothakapu 9
We have created App through app Builder not through code (Developer console) . 
console ImageComponent codedoInIt code
I am invoking the component from related list New button
AbhishekAbhishek (Salesforce Developers) 
This one no idea Vamsi.
vamshi kothakapu 9vamshi kothakapu 9
Even if I remove all the attributes except doInIt handler and remove the code from Js controller, still reloads twice when launched from rUser-added imageelated list New Button
SUCHARITA MONDALSUCHARITA MONDAL
Hi Vamsi,

Please check the following links.
https://developer.salesforce.com/forums/?id=9060G000000IAM6QAO   (actual issue)
https://salesforce.stackexchange.com/questions/223806/application-event-fired-multiple-times-multiple-copies-of-components-in-memory

Hope this helps!

Thanks,
Sucharita