mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
20 lines
377 B
React
20 lines
377 B
React
import React, { Suspense } from 'react'
|
|
import { cookies } from 'next/headers'
|
|
|
|
export default async function Page() {
|
|
return (
|
|
<Suspense fallback={<div>Loading...</div>}>
|
|
<Foobar />
|
|
</Suspense>
|
|
)
|
|
}
|
|
|
|
async function Foobar() {
|
|
try {
|
|
await cookies()
|
|
} catch (err) {
|
|
throw new Error('The original error was caught and rethrown.')
|
|
}
|
|
return null
|
|
}
|