I understand that Suspense components are the React-ian approach to code splitting, which makes webpages load faster. Now, say you have a component hierarchy like this:
<App>
<Suspense fallback={<FirstLoader/>}>
<OuterWrapper>
<Suspense fallback={<SecondLoader/>}>
<InnerWrapper>
{content}
</InnerWrapper>
</Suspense>
</OuterWrapper>
</Suspense>
</App>
Assume first that only InnerWrapper
is lazy-loaded, and in the second case they are both lazy loaded.
Does React defer the loading of InnerWrapper
after OuterWrapper
is loaded, or are they both loaded simultaneously? Specifically, whether the rendering of the 2nd Suspense's fallback is deferred after the first component is loaded.
OuterWrapper
andInnerWrapper
lazy loaded? – BunkOuterWrapper
is loaded and rendered. I might provide an example to prove that if I find some time. – Bunk