Code Splitting with React.lazy and Suspense
Learn the general mechanism of React.lazy and Suspense for splitting any part of the component tree into separately loaded chunks.
Beyond route-level splitting, React.lazy and <Suspense> can defer loading any sufficiently large or rarely-used component — a rich text editor, a complex chart, a modal only shown after a specific user action — until it's actually needed, rather than including it in the main bundle every user downloads regardless of whether they ever trigger it.
It's like keeping specialized tools in a closet instead of a work apron everyone wears all day — you fetch the specific tool (component) from the closet (a separate chunk) only at the moment a task actually calls for it, rather than every worker carrying every possible tool around all day just in case.