You need to sign in to do that
Don't have an account?
Megha 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.
Please mark as Best Answer so that it can help others in the future.
Thanks,
All Answers
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,
Please mark as Best Answer so that it can help others in the future.
Thanks,