Lazy Routes, Suspense and Loading Transitions — Concept Check
Questions on Lazy Routes, Suspense and Loading Transitions. Splitting by route is the highest-value code splitting there is: a visitor to the home page should not download the admin panel or the code editor.
Questions in this quiz
8 questions on Lazy Routes, Suspense and Loading Transitions — Concept Check. Work through them here, then start the quiz to answer them and see your score.
1.A user reports that the header and navigation disappear briefly when navigating between routes. What might be causing this issue?
- APrefetching is not implemented
- BRoute module is not split
- CSuspense boundary is placed around the layout
- DChunk failed to load after deploy
2.While deploying a new version, users report seeing 'Failed to fetch dynamically imported module'. What should you do to resolve this?
- AUse React Router's lazy for route splitting
- BOffer a page reload when a chunk fails
- CPlace Suspense boundary inside layout
- DPrefetch chunks on idle
3.A developer wants to ensure that navigation to the admin panel is instant. What technique should they use?
- APrefetch chunk on hover or focus
- BCatch chunk errors with a boundary
- CPlace Suspense boundary around layout
- DUse a single bundle for all routes
4.What is the purpose of using useTransition during route changes?
- APrefetch chunks on idle
- BKeep the current page interactive
- CCatch errors during lazy loading
- DSplit route modules for efficiency
5.Why might you avoid splitting small components on the critical path?
- AExtra request costs more than bytes saved
- BSuspense cannot handle small components
- CThey cause chunk loading errors
- DThey are not worth prefetching
6.A user navigates to a route, but the page shows a skeleton screen for too long. What could be the issue?
- AuseTransition is not used
- BChunk is not prefetched on intent
- CRoute module is not split
- DSuspense boundary is misplaced
7.What happens if you deploy a new version and remove old chunks immediately?
- AAll routes load without issues
- BPrefetching becomes unnecessary
- CNavigation becomes instant
- DUsers see 'Failed to fetch dynamically imported module'
8.What is a key benefit of splitting routes using React.lazy and Suspense?
- AAll routes load together, ensuring consistency
- BPrefetching is automatically handled
- CChunks never fail to load
- DEach route becomes its own chunk, reducing initial load