File size: 458 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import { use } from 'react'

let i

async function getData() {
  await new Promise((resolve) => setTimeout(resolve, 5000))
  return {
    message: 'hello from slow layout',
  }
}

export default function GsspLayout(props) {
  // TODO-APP: refactor this test page to `async function` instead.
  if (!i) {
    i = getData()
  }
  const data = use(i)
  return (
    <>
      <h1 id="slow-layout-message">{data.message}</h1>
      {props.children}
    </>
  )
}