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
Rasbehari DasRasbehari Das 

How to destroy or dispatch renderCallback method.

I am importing one css file from staticresources folder, css file name is datatable.css this css file i am using for lightning-datatable in my HelloWorld component and it is working fine also css  working fine as well. But if i run first HelloWorld component then HelloWorldTest component that time same css is reflecting in HelloWorldTest component. But i am not importing css file in the HelloWorldTest component. This css is not requred in the HelloWorldTest  component.
 Now my question is how to remove css or how to clear Cache memory before calling HelloWorldTest component.

HelloWorld component.
import { LightningElement, api, wire, track } from 'lwc';
import styles from '@salesforce/resourceUrl/chartNew';
import { loadStyle } from 'lightning/platformResourceLoader';

export default class HelloWorld extends LightningElement {
renderedCallback() {
        Promise.all([
            loadStyle(this, styles + '/chart/datatable.css') 
        ]).then(() => {
            window.console.log('Files loaded.');
        }).catch(error => {
            window.console.log('Error ');
        });
    }
}

HelloWorldTest component
import { LightningElement, api, wire, track } from 'lwc';
export default class HelloWorldTest extends LightningElement {

}
AbhishekAbhishek (Salesforce Developers) 
Hi,

Check this blog,

https://salesforcediaries.com/2020/01/01/renderedcallback-in-lightning-web-component/

It might help you.