We are loading a custom CSS using SPComponentLoader in SPFX Extension. We are using those styles in other web parts. But while the page loads the ui is not coming properly as the Custom CSS loads after the web part finished loading.

Is there any way to wait for the Custom Css in Extension to load first before the web part loads? Or Show the Loading indicator for the Web part till the CSS is available/everything is ready.

Thanks Snehasis

1 Answer 1


You could call the SPComponentloader in the public onInit(): Promise<void> method of your webpart. This method executes after the component has been instantiated but before it starts rendering. It's usually used to do things like loading data and so on.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.