mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
21 lines
348 B
JavaScript
21 lines
348 B
JavaScript
import { use } from 'react'
|
|
|
|
async function getData() {
|
|
return {
|
|
message: 'hello from layout',
|
|
now: Date.now(),
|
|
}
|
|
}
|
|
|
|
export default function gspLayout(props) {
|
|
const data = use(getData())
|
|
|
|
return (
|
|
<>
|
|
<h1 id="layout-message">{data.message}</h1>
|
|
<p id="layout-now">{data.now}</p>
|
|
{props.children}
|
|
</>
|
|
)
|
|
}
|