Skip to content

Commit

Permalink
Fix missing _app in AppTree rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
huozhi committed Apr 15, 2022
1 parent 9c7311b commit 95d7b5a
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions packages/next/server/render.tsx
Expand Up @@ -197,17 +197,21 @@ function enhanceComponents(

function renderFlight(AppMod: any, ComponentMod: any, props: any) {
const isServerComponent = !!ComponentMod.__next_rsc__
const isServerApp = !!AppMod.__next_rsc__
const App = interopDefault(AppMod)
const Component = interopDefault(ComponentMod)
const AppServer = isServerComponent
? (App as React.ComponentType)
: React.Fragment

return (
<AppServer>
<Component {...props} />
</AppServer>
)
if (isServerApp) {
return (
<AppServer>
<Component {...props} />
</AppServer>
)
}
return <App Component={Component} {...props} />
}

export type RenderOptsPartial = {
Expand Down

0 comments on commit 95d7b5a

Please sign in to comment.