React Advanced

0% completed

Previous
Next
Quiz
Question 1
Which React function is used to lazily load a component?
A
React.useEffect()
B
React.memo()
C
React.Lazy()
D
React.loadComponent()
Question 2
What is the role of React.Suspense in lazy loading?
A
It prevents the lazy-loaded component from rendering
B
It loads the component immediately without delay
C
It provides a fallback UI while the lazy-loaded component is being fetched
D
It forces all components to load at once
Question 3
Which of the following is the correct syntax for dynamically importing a component using React.lazy()?
A
const Component = React.lazy('./Component');
B
const Component = React.lazy(() => import('./Component'));
C
const Component = import('./Component');
D
const Component = new LazyComponent('./Component');
Question 4
How can lazy loading be implemented for React Router routes?
A
By using React.lazy() and wrapping routes inside <Suspense>
B
By importing all components at the top of the file
C
By wrapping each route inside a useEffect hook
D
By disabling JavaScript execution until navigation occurs

.....

.....

.....

Like the course? Get enrolled and start learning!
Previous
Next