Intermediate React Interview QuestionsIntermediateConcept
React · Question 67
What does a Suspense boundary do when one of its children suspends?
Direct answer
Suspense shows its fallback while content inside the boundary is not ready, then reveals the real content when the suspended work becomes ready.
Page.jsx
function Page() {
return (
<Suspense fallback={<ArticleSkeleton />}>
<Article />
</Suspense>
);
}- Code loading: a component declared with lazy can activate the boundary while its module loads.
- Suspense-enabled data: supported framework/data mechanisms can also suspend during rendering.
- Boundary placement: determines how much of the interface is replaced or revealed together.