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
Megha SachaniaMegha Sachania 

Lightning Web Component Security Review

Hello Everyone,

I am using below code in lightning web component.

renderedCallback() {

     if (!this.ready) {

       this.ready = true;

    }

if (this.selectedAccount != '') {

    this.template .querySelector('.selectedOption') .classList.remove('slds-hide');

}

}

I am facing issue : Attributes should never be modified in the renderedCallback() function as this can lead to infinite loops and self-denial of service. Please fix across the application.
Sharing Violation

Could any one help me out to resolve for the same.

Best Answer chosen by Megha Sachania
VinayVinay (Salesforce Developers) 
Hope above information was helpful.

Please mark as Best Answer so that it can help others in the future.

Thanks,

All Answers

VinayVinay (Salesforce Developers) 
Hi Megha,

Try to use wire handlers instead.

Reference examples:
https://developer.salesforce.com/docs/component-library/documentation/en/lwc/apex_wire_method
https://salesforce.stackexchange.com/questions/295726/process-results-from-two-different-wire-methods-after-the-wires-are-finished
https://salesforcediaries.com/2020/01/01/renderedcallback-in-lightning-web-component/

Thanks,
Megha SachaniaMegha Sachania
Thanks Vinay
VinayVinay (Salesforce Developers) 
Hope above information was helpful.

Please mark as Best Answer so that it can help others in the future.

Thanks,
This was selected as the best answer
Megha SachaniaMegha Sachania
Can You help me out regarding Appexchange security review issues also
VinayVinay (Salesforce Developers) 
You can close this and post a new question with all details so that we can take a look and see if that helps.