Loading

Quipoin Menu

Learn • Practice • Grow

react / Code Splitting and Lazy Loading
mcq
Direction: Choose the correct option

Q1.

What is code splitting in React?
A. Dividing code into multiple files
B. Using multiple bundles
C. Splitting the code bundle into smaller chunks that can be loaded on demand
D. A build tool feature
Direction: Choose the correct option

Q2.

Which React function enables lazy loading of components?
A. React.lazy()
B. React.loadable()
C. React.split()
D. React.suspense()
Direction: Choose the correct option

Q3.

What component must wrap lazy components to show a fallback while loading?
A. <Suspense>
B. <Lazy>
C. <Fallback>
D. <Loading>
Direction: Choose the correct option

Q4.

How do you use React.lazy?
A. const MyComponent = React.lazy(import('./MyComponent'));
B. const MyComponent = React.lazy(() => import('./MyComponent'));
C. const MyComponent = lazy(import('./MyComponent'));
D. import MyComponent from './MyComponent';
Direction: Choose the correct option

Q5.

What happens if a lazy component fails to load?
A. Nothing
B. The fallback shows indefinitely
C. The app crashes
D. An error is thrown; you can use an error boundary to handle it