Skip to content

Commit

Permalink
rename
Browse files Browse the repository at this point in the history
  • Loading branch information
shuding committed Apr 17, 2023
1 parent fe8d958 commit 1810d9a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 17 deletions.
6 changes: 3 additions & 3 deletions packages/next/src/client/components/layout-router.tsx
Expand Up @@ -453,7 +453,7 @@ export default function OuterLayoutRouter({
notFound,
notFoundStyles,
asNotFound,
assets,
styles,
}: {
parallelRouterKey: string
segmentPath: FlightSegmentPath
Expand All @@ -468,7 +468,7 @@ export default function OuterLayoutRouter({
notFound: React.ReactNode | undefined
notFoundStyles: React.ReactNode | undefined
asNotFound?: boolean
assets?: React.ReactNode
styles?: React.ReactNode
}) {
const context = useContext(LayoutRouterContext)
if (!context) {
Expand Down Expand Up @@ -503,7 +503,7 @@ export default function OuterLayoutRouter({

return (
<>
{assets}
{styles}
{preservedSegments.map((preservedSegment) => {
const isChildPropSegment = matchSegment(
preservedSegment,
Expand Down
25 changes: 11 additions & 14 deletions packages/next/src/server/app-render/app-render.tsx
Expand Up @@ -605,7 +605,7 @@ export async function renderToHTMLOrFlight(
asNotFound?: boolean
}): Promise<{
Component: React.ComponentType
assets: React.ReactNode
styles: React.ReactNode
}> => {
const { page, layoutOrPagePath, segment, components, parallelRoutes } =
parseLoaderTree(tree)
Expand Down Expand Up @@ -854,7 +854,7 @@ export async function renderToHTMLOrFlight(
}

// Create the child component
const { Component: ChildComponent, assets: childAssets } =
const { Component: ChildComponent, styles: childStyles } =
await createComponentTree({
createSegmentPath: (child) => {
return createSegmentPath([...currentSegmentPath, ...child])
Expand Down Expand Up @@ -902,7 +902,7 @@ export async function renderToHTMLOrFlight(
notFoundStyles={notFoundStyles}
asNotFound={asNotFound}
childProp={childProp}
assets={childAssets}
styles={childStyles}
/>,
]
}
Expand All @@ -922,7 +922,7 @@ export async function renderToHTMLOrFlight(
if (!Component) {
return {
Component: () => <>{parallelRouteComponents.children}</>,
assets: styles,
styles,
}
}

Expand Down Expand Up @@ -986,7 +986,7 @@ export async function renderToHTMLOrFlight(
</>
)
},
assets: styles,
styles,
}
}

Expand Down Expand Up @@ -1320,7 +1320,7 @@ export async function renderToHTMLOrFlight(
const injectedCSS = new Set<string>()
const injectedFontPreloadTags = new Set<string>()

const { Component: ComponentTree, assets } = await createComponentTree({
const { Component: ComponentTree, styles } = await createComponentTree({
createSegmentPath: (child) => child,
loaderTree,
parentParams: {},
Expand Down Expand Up @@ -1356,7 +1356,7 @@ export async function renderToHTMLOrFlight(

return (
<>
{assets}
{styles}
<AppRouter
assetPrefix={assetPrefix}
initialCanonicalUrl={initialCanonicalUrl}
Expand All @@ -1375,13 +1375,10 @@ export async function renderToHTMLOrFlight(
globalErrorComponent={GlobalError}
notFound={
NotFound && RootLayout ? (
<>
{assets}
<RootLayout params={{}}>
{notFoundStyles}
<NotFound />
</RootLayout>
</>
<RootLayout params={{}}>
{notFoundStyles}
<NotFound />
</RootLayout>
) : undefined
}
asNotFound={props.asNotFound}
Expand Down

0 comments on commit 1810d9a

Please sign in to comment.