DEV Community

Discussion on: Frontend Performance Optimization with Code Splitting using React.Lazy & Suspense 🔥

Collapse
 
frondor profile image
Federico Vázquez

This can be counter-productive if not used properly.
One can think of this as a solution for every component and make everything lazy-loaded, but then the application performance is going to be negatively impacted by the extra requests and network overhead, as well as the UX with all the Suspense flickering (if not handled properly with something like skeleton placeholders).

I'd say that this approach is good for page contents, and works very well for PWAs applying the App Shell pattern.

Collapse
 
yuvrajpy profile image
Yuvraj Pandey • Edited

Agreed to your thoughts completely…..such approach should be dealt very cautiously as it may lead to weird issues. The only time i would suggest such approach would be when you wana improve your page load time by avoiding loading of components which a user wont require at the start which may include heavy libraries like a PDF renderer etc