mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
Adds handling for
```tsx
export { unstable_instant } from './config'
^
```
```tsx
const unstable_instant = ...
^
export { unstable_instant }
```
```tsx
const instant = ...
^
export { instant as unstable_instant }
```
We're not following assignments recursively and stop at the first declaration:
```tsx
const _instant = ...
const instant = _instant
^
export { instant as unstable_instant }
```
35 lines
699 B
TypeScript
35 lines
699 B
TypeScript
import { connection } from 'next/server'
|
|
import { ReactNode, Suspense } from 'react'
|
|
|
|
export default function RootLayout({ children }: { children: ReactNode }) {
|
|
return (
|
|
<Suspense fallback={<div>Root suspense boundary...</div>}>
|
|
<html>
|
|
<body style={{ fontFamily: 'monospace' }}>
|
|
<Header />
|
|
<hr />
|
|
{children}
|
|
</body>
|
|
</html>
|
|
</Suspense>
|
|
)
|
|
}
|
|
|
|
function Header() {
|
|
return (
|
|
<header>
|
|
<a href="/">Home</a>{' '}
|
|
<Suspense fallback="...">
|
|
<div id="root-layout-timestamp">
|
|
<Now />
|
|
</div>
|
|
</Suspense>
|
|
</header>
|
|
)
|
|
}
|
|
|
|
async function Now() {
|
|
await connection()
|
|
return Date.now()
|
|
}
|