React.lazy

Creator
Creator
Seonglae ChoSeonglae Cho
Created
Created
2024 Feb 11 3:58
Editor
Edited
Edited
2024 Feb 11 4:1
  • Client-Side Code Splitting: React.lazy is a React feature introduced in version 16.6 that allows you to render a dynamic import as a regular component. It is primarily used for code splitting and lazy loading components in the client-side environment.
  • Suspense Integration: It must be used in conjunction with the Suspense component, which lets you specify the loading indicator while the lazy-loaded component is being fetched.
  • Limitations: React.lazy and Suspense are not yet available for server-side rendering in React. This means that if you're using React.lazy in a Next.js project, the lazy-loaded components will only be split and lazy-loaded in the client-side bundle, not during SSR.
 
 
 
 
 
 
 

Recommendations