next.js/test/development/app-dir/async-request-warnings/app/request/headers/page.tsx
page.tsx21 lines485 B
import { headers } from 'next/headers'

function Component() {
  // Cast to any as we removed UnsafeUnwrapped types, but still need to test with the sync access
  ;(headers() as any).get('component')
  ;(headers() as any).has('component')

  const allHeaders = [...(headers() as any)]
  return <pre>{JSON.stringify(allHeaders, null, 2)}</pre>
}

export default function Page() {
  ;(headers() as any).get('page')
  return (
    <>
      <Component />
      <Component />
    </>
  )
}
Quest for Codev2.0.0
/
SIGN IN