next.js/test/e2e/app-dir/use-cache/app/(dynamic)/complex-args/page.tsx
page.tsx19 lines479 B
async function getCached({ p }) {
  'use cache'
  const array = await p
  if (array instanceof Uint8Array) {
    return array[0].toString(16) + '-' + Math.random()
  }
  return 'invalid'
}

export default async function Page({
  searchParams,
}: {
  searchParams: Promise<Record<string, string | string[] | undefined>>
}) {
  const n = parseInt((await searchParams).n as any, 16)
  const p = Promise.resolve(new Uint8Array([n]))
  return <p id="x">{await getCached({ p })}</p>
}
Quest for Codev2.0.0
/
SIGN IN