5 min read
•Question 23 of 48mediumCode Splitting and Lazy Loading
Loading components on demand.
What is Lazy Loading?
Lazy loading means loading components only when they're needed, reducing initial bundle size.
React.lazy
React.lazy lets you define a component that is loaded dynamically. Must be used with Suspense.
Benefits
- Faster initial load
- Load code on demand
- Better user experience