React.lazy and Suspense
Multiple Choice Medium
Question
What does React.lazy do?
Hint
Think about reducing the initial bundle size.
Explanation
React.lazy enables code splitting — the component's code is loaded on demand when first rendered. You wrap it in <Suspense> with a fallback to show a loading indicator while the code downloads. This reduces the initial bundle size.
Related Resources
Related Lessons
Look up unfamiliar terms
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.
Build real projects
Apply what you learned by building guided projects with starter code and solutions.