mirror of
https://github.com/vercel/next.js.git
synced 2026-09-20 02:25:18 +08:00
20f5db06fa
Precompile `react@next` and to unlock `cache` and `use` API
20 lines
361 B
JavaScript
20 lines
361 B
JavaScript
import { use } from 'react'
|
|
|
|
async function getData() {
|
|
await new Promise((resolve) => setTimeout(resolve, 400))
|
|
return {
|
|
message: 'Hello World',
|
|
}
|
|
}
|
|
|
|
export default function DashboardLayout({ children }) {
|
|
const { message } = use(getData())
|
|
|
|
return (
|
|
<>
|
|
<h1 id="dashboard-layout">Dashboard {message}</h1>
|
|
{children}
|
|
</>
|
|
)
|
|
}
|