DEV Community

Discussion on: React.lazy, What and how to use in your app

Collapse
 
conantonakos profile image
Constantine Antonakos • Edited

Would this be a good use case for lazy loading a component that imports a large npm package? In other words, I used to dynamically import these type of packages with import() in the React component lifecycle before rendering something.

Collapse
 
vigzmv profile image
Vignesh M

Yes, just be sure that package isn't already imported by any other component.