lazy and Suspense
lazy loads a component on demand and Suspense shows a fallback.
Example
const Chart = lazy(() => import("./Chart"));
function App() {
return <Suspense fallback={<p>Loading</p>}><Chart /></Suspense>;
}Exercise
Loading UI.
<Suspense ={<p>Wait</p>}>
Quiz Test
These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.