Skip to content

Commit

Permalink
update default layout
Browse files Browse the repository at this point in the history
  • Loading branch information
ijjk committed May 5, 2022
1 parent 244a1c8 commit 5a5968c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 17 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import React from 'react'

export type RootProps = {
export type LayoutProps = {
headChildren: any
bodyChildren: any
}

export default function RootLayout({ headChildren, bodyChildren }: RootProps) {
export default function ViewsLayout({
headChildren,
bodyChildren,
}: LayoutProps) {
return (
<html>
<head>
Expand Down
2 changes: 1 addition & 1 deletion packages/next/server/view-render.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { FlushEffectsContext } from '../shared/lib/flush-effects'
import ReactDOMServer from 'react-dom/server.browser'
import { isDynamicRoute } from '../shared/lib/router/utils'
import { tryGetPreviewData } from './api-utils/node'
import DefaultRootLayout from '../pages/layout'
import DefaultRootLayout from '../lib/views-layout'

export type RenderOptsPartial = {
err?: Error | null
Expand Down
15 changes: 1 addition & 14 deletions packages/next/taskfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -1887,22 +1887,9 @@ export async function pages_document(task, opts) {
.target('dist/pages')
}

export async function pages_layout(task, opts) {
await task
.source('pages/layout.tsx')
.swc('server', { dev: opts.dev, keepImportAssertions: true })
.target('dist/pages')
}

export async function pages(task, opts) {
await task.parallel(
[
'pages_app',
'pages_app_server',
'pages_error',
'pages_document',
'pages_layout',
],
['pages_app', 'pages_app_server', 'pages_error', 'pages_document'],
opts
)
}
Expand Down

0 comments on commit 5a5968c

Please sign in to comment.