mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
Fixes a bug where a loading.js isn't properly considered as providing a suspense boundary for a page. This is because we're placing the boundary around the segment component itself, but it should be rendered above the `LoadingBoundary` that is rendered around it (in `OuterLayoutRouter`). This PR reworks the boundary placement logic to insert the boundary above ErrorBoundary/LoadingBoundary (but below TemplateContext). It's a little bit tricky to communicate this from `instant-validation` to the client router. Instead of placing the boundary directly like before, we now add a context to the innermost parent segment (`PlaceValidationBoundaryBelowThisLevel`) and then the `OuterLayoutRouter`s for the segments below see this context value and add the validation boundary (`RenderValidationBoundaryAtThisLevel`)
4 lines
69 B
TypeScript
4 lines
69 B
TypeScript
export default function Loading() {
|
|
return <div>Loading...</div>
|
|
}
|