Unverified Commit f91cdec4 authored by Jiachi Liu's avatar Jiachi Liu Committed by GitHub

test: migrate rest async api usage in tests (#71663)

parent 03ff785c
......@@ -3,7 +3,7 @@ import { cookies } from 'next/headers'
export function validator(action) {
return async function (arg) {
'use server'
const auth = cookies().get('edge-auth')
const auth = (await cookies()).get('edge-auth')
if (auth?.value !== '1') {
throw new Error('Unauthorized request')
}
......
export default function Page({ params }) {
export default async function Page(props) {
const params = await props.params
return (
<div>
Catchall <pre>{JSON.stringify(params)}</pre>{' '}
......
......@@ -7,7 +7,8 @@ const fetchCategory = async (categorySlug) => {
return categorySlug + 'abc'
}
export default function Page({ params }) {
export default function Page(props) {
const params = use(props.params)
const category = use(fetchCategory(params.categorySlug))
return <div id="category-id">{category}</div>
......
......@@ -2,8 +2,8 @@
import ClientComp from './client-component'
import { headers } from 'next/headers'
export default function Page() {
export default async function Page() {
// Opt-in to SSR.
headers()
await headers()
return <ClientComp />
}
......@@ -3,7 +3,7 @@ import { ClientHooks } from './client-hooks'
import { headers, cookies } from 'next/headers'
export function useHooks() {
headers()
use(headers())
use(cookies())
return <ClientHooks />
}
......@@ -20,7 +20,7 @@ export async function generateStaticParams() {
]
}
export default async function Page({ params }) {
export default async function Page() {
const data = await fetch(
`http://localhost:${process.env.TEST_SERVER_PORT}?status=404`
).then((res) => res.text())
......
......@@ -18,7 +18,7 @@ export async function generateStaticParams() {
]
}
export default async function Page({ params }) {
export default async function Page() {
const data = await fetch(
`http://localhost:${process.env.TEST_SERVER_PORT}`
).then((res) => res.text())
......
import { headers } from 'next/headers'
export default function SSRPage() {
const headersObj = Object.fromEntries(headers())
export default async function SSRPage() {
const headersObj = Object.fromEntries(await headers())
return (
<>
<p>app-dir</p>
......
......@@ -8,7 +8,7 @@ import { headers as nextHeaders, draftMode } from 'next/headers'
export async function middleware(request) {
const headersFromRequest = new Headers(request.headers)
// It should be able to import and use `headers` inside middleware
const headersFromNext = nextHeaders()
const headersFromNext = await nextHeaders()
headersFromRequest.set('x-from-middleware', 'hello-from-middleware')
// make sure headers() from `next/headers` is behaving properly
......
export default async function DynamicPage({ params, searchParams }) {
export default async function DynamicPage(props) {
return <div id="dynamic-prefetch-page">Hello from Dynamic Prefetch Page</div>
}
export const regions = ['SE', 'DE']
export default async function Layout({ children, params }) {
export default function Layout({ children }) {
return children
}
......
export const dynamic = 'force-dynamic'
export default async function StaticPrefetchPage({ params }) {
export default function StaticPrefetchPage(props) {
return (
<div id="static-prefetch-page">
<h1>Hello from Static Prefetch Page</h1>
......
......@@ -12,7 +12,8 @@ export function generateStaticParams() {
return [{ id: 'static' }]
}
export default function IdPage({ params }) {
export default function IdPage(props) {
const params = use(props.params)
const data = use(getData())
console.log(data)
......
......@@ -9,7 +9,8 @@ function getData() {
return res
}
export default async function Page({ params }) {
export default async function Page(props) {
const params = await props.params
const result = await getData()
return (
......
......@@ -9,8 +9,9 @@ export function generateStaticParams() {
export const GET = async (
req: NextRequest,
{ params }: { params: Promise<{ slug: string }> }
props: { params: Promise<{ slug: string }> }
) => {
const params = await props.params
const resolvedParams = await params
return NextResponse.json({ params: resolvedParams, now: Date.now() })
}
......@@ -7,8 +7,9 @@ export function generateStaticParams() {
export const GET = async (
req: NextRequest,
{ params }: { params: Promise<{ slug: string }> }
props: { params: Promise<{ slug: string }> }
) => {
const params = await props.params
const resolvedParams = await params
return NextResponse.json({ params: resolvedParams, now: Date.now() })
}
......@@ -2,7 +2,8 @@ import { notFound } from 'next/navigation'
export const dynamicParams = true
export default function Page({ params }) {
export default async function Page(props) {
const params = await props.params
if (params.author === 'shu') {
notFound()
}
......
export default function Layout({ children, params }) {
export default async function Layout(props) {
const params = await props.params
const { children } = props
return (
<>
<p id="author-layout-params">{JSON.stringify(params)}</p>
......
......@@ -2,7 +2,8 @@ import Link from 'next/link'
export const dynamicParams = false
export default async function Page({ params }) {
export default async function Page(props) {
const params = await props.params
await fetch('https://example.vercel.sh', {
next: { revalidate: 10 },
})
......
......@@ -2,7 +2,8 @@ import { cookies } from 'next/headers'
export const dynamic = 'error'
export default async function Page({ params }) {
export default async function Page(props) {
const params = await props.params
// When PPR is enabled, we will bailout on parameter access.
if (!process.env.__NEXT_EXPERIMENTAL_PPR) {
if (params.id.includes('static-bailout')) {
......
export const revalidate = 0
export default function Page({ params }) {
export default async function Page(props) {
const params = await props.params
return (
<>
<p id="page">/dynamic-no-gen-params-ssr</p>
......
'use client'
import { use } from 'react'
import Link from 'next/link'
export default function Page({ params }) {
export default function Page(props) {
const params = use(props.params)
return (
<>
<p id="page">/dynamic-no-gen-params</p>
......
export const dynamic = 'force-dynamic'
export default function Page({ params }) {
export default function Page(props) {
throw new Error('this should not attempt prerendering with force-dynamic')
}
......@@ -8,7 +8,8 @@ export const generateStaticParams = async () => {
return [{ slug: 'frameworks' }]
}
export default async function Page({ params }) {
export default async function Page(props) {
const params = await props.params
const result = (await cookies()).get('session')?.value
? 'has cookie'
: 'no cookie'
......
......@@ -13,7 +13,8 @@ function Dynamic({ params }) {
return <p id="params">{JSON.stringify(params)}</p>
}
export default function Page({ params }) {
export default async function Page(props) {
const params = await props.params
return (
<Suspense>
<p id="page">/force-static/[slug]</p>
......
import { cookies, headers } from 'next/headers'
export default function Layout({ children }) {
const curHeaders = headers()
const curCookies = cookies()
export default async function Layout({ children }) {
const curHeaders = await headers()
const curCookies = await cookies()
return (
<>
......
......@@ -6,7 +6,8 @@ export async function generateStaticParams() {
return [{ slug: 'one' }]
}
export default async function page({ params }) {
export default async function page(props) {
const params = await props.params
const { slug } = params
let data
......
......@@ -4,7 +4,8 @@ export async function generateStaticParams() {
return [{ slug: 'one' }]
}
export default async function page({ params }) {
export default async function page(props) {
const params = await props.params
const { slug } = params
const data = await fetchRetry(
'https://next-data-api-endpoint.vercel.app/api/random',
......
......@@ -23,7 +23,8 @@ export async function generateStaticParams() {
]
}
export default function Page({ params }) {
export default async function Page(props) {
const params = await props.params
return (
<>
<p id="page">/partial-gen-params/[lang]/[slug]</p>
......
......@@ -23,7 +23,8 @@ export async function generateStaticParams() {
]
}
export default function Page({ params }) {
export default async function Page(props) {
const params = await props.params
return (
<>
<p id="page">/partial-gen-params/[lang]/[slug]</p>
......
export default function Page({ params }) {
export default async function Page(props) {
const params = await props.params
return (
<>
<p id="page">/partial-gen-params/[lang]/[slug]</p>
......
......@@ -5,7 +5,7 @@ export default async function Page() {
'https://next-data-api-endpoint.vercel.app/api/random'
).then((res) => res.text())
const { isEnabled } = draftMode()
const { isEnabled } = await draftMode()
return (
<main>
......
......@@ -2,9 +2,10 @@ import { cookies } from 'next/headers'
export const dynamic = 'force-static'
export default function Page({ params }) {
export default async function Page(props) {
const params = await props.params
if (params.id.includes('static-bailout')) {
console.log('calling cookies', cookies())
console.log('calling cookies', await cookies())
}
return (
......
import { cookies } from 'next/headers'
export default function Page({ params }) {
export default async function Page(props) {
const params = await props.params
if (params.id.includes('static-bailout')) {
console.log('calling cookies', cookies())
console.log('calling cookies', await cookies())
}
return (
......
......@@ -2,7 +2,7 @@ import { cookies } from 'next/headers'
import { NextResponse } from 'next/server'
export async function GET() {
const cookieData = cookies()
const cookieData = await cookies()
const data = await fetch(
'https://next-data-api-endpoint.vercel.app/api/random',
......
'use client'
import { use } from 'react'
import Link from 'next/link'
import { useRouter } from 'next/navigation'
export default function Page({ params }) {
export default function Page(props) {
const params = use(props.params)
const router = useRouter()
return (
<>
......
export const runtime = 'edge'
export default function Page({ params }) {
export default async function Page(props) {
const params = await props.params
return (
<>
<p>catch-all edge page</p>
......
export default function Page({ params }) {
export default async function Page(props) {
const params = await props.params
return (
<h1 id="text" data-params={params.slug?.join('/') ?? ''}>
hello from /catch-all-optional/{params.slug?.join('/')}
......
import Widget from './components/widget'
import NotAPage from './not-a-page'
export default function Page({ params }) {
export default async function Page(props) {
const params = await props.params
return (
<>
<h1 id="text" data-params={params.slug.join('/') ?? ''}>
......
export default function Page({ params }) {
export default async function Page(props) {
const params = await props.params
return (
<>
<p id="message">
......
export default function IdLayout({ children, params }) {
export default async function IdLayout(props) {
const params = await props.params
const { children } = props
return (
<>
<h3>
......
'use client'
import { use } from 'react'
import { useSearchParams } from 'next/navigation'
import dynamic from 'next/dynamic'
......@@ -7,7 +8,11 @@ const Button = dynamic(() =>
import('../../../../components/button/button').then((mod) => mod.Button)
)
export default function IdPage({ children, params }) {
export default function IdPage(props) {
const params = use(props.params)
const { children } = props
return (
<>
<p>
......
export default function CategoryLayout({ children, params }) {
export default async function CategoryLayout(props) {
const params = await props.params
const { children } = props
return (
<>
<h2>
......
export default function DynamicLayout({ children, params }) {
export default async function DynamicLayout(props) {
const params = await props.params
const { children } = props
return (
<>
<h1>
......
export default function IdLayout({ children, params }) {
export default async function IdLayout(props) {
const params = await props.params
const { children } = props
return (
<>
<h3>
......
export default async function IdPage({ children, params, searchParams }) {
export default async function IdPage(props) {
const params = await props.params
const searchParams = await props.searchParams
const { children } = props
return (
<>
<p>
......
export default function CategoryLayout({ children, params }) {
export default async function CategoryLayout(props) {
const params = await props.params
const { children } = props
return (
<>
<h2>
......
export default function DynamicLayout({ children, params }) {
export default async function DynamicLayout(props) {
const params = await props.params
const { children } = props
return (
<>
<h1>
......
import Link from 'next/link'
import { nanoid } from 'nanoid'
export default function Page({ params }) {
export default async function Page(props) {
const params = await props.params
const other = params.id === '123' ? '456' : '123'
return (
<>
......
import Link from 'next/link'
import { nanoid } from 'nanoid'
export default function Page({ params }) {
export default async function Page(props) {
const params = await props.params
const other = params.id === '123' ? '456' : '123'
return (
<>
......
......@@ -7,7 +7,8 @@ const fetchCategory = async (categorySlug) => {
return categorySlug + 'abc'
}
export default function Page({ params }) {
export default function Page(props) {
const params = use(props.params)
const category = use(fetchCategory(params.categorySlug))
return <div id="category-id">{category}</div>
......
'use client'
export default async function Page({ params, searchParams }) {
import { use } from 'react'
export default function Page(props) {
const searchParams = use(props.searchParams)
const params = use(props.params)
return (
<h1
id="params-and-query"
data-params={params.slug}
data-query={(await searchParams).slug}
data-query={searchParams.slug}
>
hello from /param-and-query/{params.slug}?slug={(await searchParams).slug}
hello from /param-and-query/{params.slug}?slug={searchParams.slug}
</h1>
)
}
export default function DeploymentsPage(props) {
export default async function DeploymentsPage(props) {
return (
<>
<p>hello from app/partial-match-[id]. ID is: {props.params.id}</p>
<p>hello from app/partial-match-[id]. ID is: {(await props.params).id}</p>
</>
)
}
import Button from './client-component'
import { headers } from 'next/headers'
export default function Page() {
const headerStore = headers()
export default async function Page() {
const headerStore = await headers()
const headerValue = headerStore.get('test') || 'empty'
return (
......
......@@ -8,7 +8,8 @@ export function generateStaticParams() {
]
}
export default function Page({ params }) {
export default async function Page(props) {
const params = await props.params
return (
<>
<p>/app-ssg/[slug]</p>
......
......@@ -3,7 +3,7 @@ import { unstable_cache as cache } from 'next/cache'
const cachedConnection = cache(async () => connection())
export default async function Page({ searchParams }) {
export default async function Page(props) {
await cachedConnection()
return (
<div>
......
......@@ -17,7 +17,7 @@ export default async function Page({ searchParams }) {
</section>
<section id="headers">
<h3>headers</h3>
{Array.from(headers().entries()).map(([key, value]) => {
{Array.from((await headers()).entries()).map(([key, value]) => {
if (key === 'cookie') return null
return (
<div key={key}>
......
......@@ -17,7 +17,7 @@ export default async function Page({ searchParams }) {
</section>
<section id="headers">
<h3>headers</h3>
{Array.from(headers().entries()).map(([key, value]) => {
{Array.from((await headers()).entries()).map(([key, value]) => {
if (key === 'cookie') return null
return (
<div key={key}>
......
......@@ -15,7 +15,7 @@ export default async function Page({ searchParams }) {
</section>
<section id="headers">
<h3>headers</h3>
{Array.from(headers().entries()).map(([key, value]) => {
{Array.from((await headers()).entries()).map(([key, value]) => {
if (key === 'cookie') return null
return (
<div key={key}>
......
......@@ -2,7 +2,7 @@ import { connection } from 'next/server'
export const dynamic = 'error'
export default async function Page({ searchParams }) {
export default async function Page(props) {
await connection()
return (
<div>
......
......@@ -2,7 +2,7 @@ import { cookies } from 'next/headers'
export const dynamic = 'error'
export default async function Page({ searchParams }) {
export default async function Page(props) {
return (
<div>
<section>
......
......@@ -11,7 +11,7 @@ export default async function Page() {
</section>
<section id="headers">
<h3>headers</h3>
{Array.from(headers().entries()).map(([key, value]) => {
{Array.from((await headers()).entries()).map(([key, value]) => {
if (key === 'cookie') return null
return (
<div key={key}>
......
......@@ -3,7 +3,8 @@ export async function generateStaticParams() {
return [{ slug: 'foo' }, { slug: 'bar' }, { slug: 'baz' }]
}
export default function Page({ params }) {
export default async function Page(props) {
const params = await props.params
const { slug } = params
return <div>Hello from {slug}</div>
}
......
export const runtime = 'edge'
export const dynamic = 'force-dynamic'
export function GET(req, { params }) {
export async function GET(req, props) {
const params = await props.params
return new Response(
`Hello from /app/dynamic/[slug]/route.ts. Slug: ${params.slug}`
)
......
import ClientComp from './client-component'
import { headers } from 'next/headers'
export default function Page() {
export default async function Page() {
// Opt-in to SSR.
headers()
await headers()
return <ClientComp />
}
import { redirect, notFound } from 'next/navigation'
export default async function TeamDashboardPage({ params }: any) {
export default async function TeamDashboardPage(props: any) {
const params = await props.params
await new Promise((resolve) => setTimeout(resolve, 1000))
const username = 'vercel-user'
if (params.teamSlug === username) {
......
import { nanoid } from 'nanoid'
import { headers } from 'next/headers'
export default function Page() {
headers()
export default async function Page() {
await headers()
return (
<>
<h1>Dynamic Page</h1>
......
import { draftMode } from 'next/headers'
export default function Page() {
const { isEnabled } = draftMode()
export default async function Page() {
const { isEnabled } = await draftMode()
return (
<>
......
import { headers } from 'next/headers'
export default function Page() {
const headersList = headers()
export default async function Page() {
const headersList = await headers()
const hasHeader = headersList.get('x-use-headers') === 'value'
const referer = headersList.get('referer')
......
import React from 'react'
import ShowParams from '../../../show-params'
export default async function Layout({
children,
params,
}: {
export default async function Layout(props: {
children: React.ReactNode
params: Promise<{}>
}) {
const params = await props.params
const { children } = props
return (
<div>
<ShowParams prefix="lvl3" params={await params} />
......
import React from 'react'
import ShowParams from '../../show-params'
export default async function Layout({
children,
params,
}: {
export default async function Layout(props: {
children: React.ReactNode
params: Promise<{}>
}) {
const params = await props.params
const { children } = props
return (
<div>
<ShowParams prefix="lvl2" params={await params} />
......
import React from 'react'
import ShowParams from '../show-params'
export default async function Layout({
children,
params,
}: {
export default async function Layout(props: {
children: React.ReactNode
params: Promise<{}>
}) {
const params = await props.params
const { children } = props
return (
<div>
<ShowParams prefix="lvl1" params={await params} />
......
import React from 'react'
import ShowParams from '../../show-params'
export default async function Layout({
children,
params,
}: {
export default async function Layout(props: {
children: React.ReactNode
params: Promise<{}>
}) {
const params = await props.params
const { children } = props
return (
<div>
<ShowParams prefix="lvl2" params={await params} />
......
import React from 'react'
import ShowParams from './show-params'
export default async function Layout({
children,
params,
}: {
export default async function Layout(props: {
children: React.ReactNode
params: Promise<{}>
}) {
const params = await props.params
const { children } = props
return (
<html>
<head></head>
......
import React from 'react'
import ShowParams from '../../show-params'
export default async function Layout({
children,
params,
}: {
export default async function Layout(props: {
children: React.ReactNode
params: Promise<{}>
}) {
const params = await props.params
const { children } = props
return (
<div>
<ShowParams prefix="lvl2" params={await params} />
......
import { headers } from 'next/headers'
export default function Page() {
headers()
export default async function Page() {
await headers()
return <p>{'headers()'}</p>
}
......@@ -4,7 +4,8 @@ import { cliLog } from '../../../../utils/log'
const thing = cache(() => Symbol('cache me please'))
export default function Index({ params }) {
export default async function Index(props) {
const params = await props.params
const valueFromRender = thing()
after(() => {
......
......@@ -4,7 +4,8 @@ import { cliLog } from '../../../../utils/log'
const thing = cache(() => Symbol('cache me please'))
export default function Index({ params }) {
export default async function Index(props) {
const params = await props.params
const action = async () => {
'use server'
......
import { unstable_after as after } from 'next/server'
import { cliLog } from '../../../../utils/log'
export function generateMetadata({ params }) {
export async function generateMetadata(props) {
const params = await props.params
after(() => {
cliLog({
source: '[metadata] /[id]/with-metadata',
......
......@@ -4,7 +4,7 @@ import { cliLog } from '../../../utils/log'
const thing = cache(() => Symbol('cache me please'))
export default async function Index({ params }) {
export default async function Index(props) {
await connection()
const valueFromRender = thing()
......
import { notFound } from 'next/navigation'
export default function Page({ params }) {
export default async function Page(props) {
const params = await props.params
if (params.id === '404') {
notFound()
}
......
......@@ -3,7 +3,11 @@ import { notFound } from 'next/navigation'
// avoid static generation to fill the dynamic params
export const dynamic = 'force-dynamic'
export default function Page({ params: { id } }) {
export default async function Page(props) {
const params = await props.params
const { id } = params
if (id === '404') {
notFound()
}
......
......@@ -3,7 +3,11 @@ import { notFound } from 'next/navigation'
// avoid static generation to fill the dynamic params
export const dynamic = 'force-dynamic'
export default function Page({ params: { id } }) {
export default async function Page(props) {
const params = await props.params
const { id } = params
if (id === '404') {
notFound()
}
......
import { notFound } from 'next/navigation'
import React from 'react'
export default function Page({ params }) {
export default async function Page(props) {
const params = await props.params
if (params.dynamic === 'trigger-not-found') {
notFound()
}
......
......@@ -2,7 +2,8 @@ import { notFound } from 'next/navigation'
export const dynamic = 'force-dynamic'
export default function Page({ params }) {
export default async function Page(props) {
const params = await props.params
if (params.id === '404') {
notFound()
}
......
export default function Page({ params }) {
export default function Page(props) {
return <div>default modal slot</div>
}
export default function Page({ params }) {
export default function Page(props) {
return <div>/[locale]/nested/[foo]/[bar]/@slot/[baz]/page.tsx</div>
}
export default function Page({ params }) {
export default function Page(props) {
return <div>/[locale]/nested/[foo]/[bar]/@slot0/[baz]/page.tsx</div>
}
export default function Page({ params }) {
export default function Page(props) {
return <div>/[locale]/nested/[foo]/[bar]/@slot0/default.tsx</div>
}
export default function Page({ params }) {
export default function Page(props) {
return <div>/[locale]/nested/[foo]/[bar]/@slot1/[baz]/[qux]/page.tsx</div>
}
export default function Page({ params }) {
export default function Page(props) {
return <div>/[locale]/nested/[foo]/[bar]/@slot1/[baz]/page.tsx</div>
}
export default function Page({ params }) {
export default function Page(props) {
return <div>/[locale]/nested/@slot0/bar/page.tsx</div>
}
export default function Page({ params }) {
export default function Page(props) {
return <div>/[locale]/nested/@slot0/foo/page.tsx</div>
}
export default function Page({ params }) {
export default function Page(props) {
return <div>/[locale]/nested/@slot1/baz/page.tsx</div>
}
......@@ -4,12 +4,14 @@ import { UpdateSearchParamsButton } from '../../../../components/UpdateSearchPar
const getRandom = async () => Math.random()
export default async function Page({ params, searchParams }) {
export default async function Page(props) {
const searchParams = await props.searchParams
const params = await props.params
const someProp = await getRandom()
return (
<dialog open>
<div>{(await params).dynamic}</div>
<div>{params.dynamic}</div>
<div style={{ display: 'flex', flexDirection: 'column' }}>
<div>
<span>Modal Page</span>
......@@ -17,10 +19,7 @@ export default async function Page({ params, searchParams }) {
</div>
<RefreshButton />
<RevalidateButton />
<UpdateSearchParamsButton
searchParams={await searchParams}
id="modal"
/>
<UpdateSearchParamsButton searchParams={searchParams} id="modal" />
</div>
</dialog>
)
......
import Link from 'next/link'
import { UpdateSearchParamsButton } from '../../components/UpdateSearchParamsButton'
export default async function Home({ searchParams }) {
const sp = await searchParams
export default async function Home(props) {
const searchParams = await props.searchParams
return (
<main>
<Link href="/dynamic-refresh/foo/login">
......@@ -11,7 +11,7 @@ export default async function Home({ searchParams }) {
<div>
Random # from Root Page: <span id="random-number">{Math.random()}</span>
</div>
<UpdateSearchParamsButton searchParams={sp} />
<UpdateSearchParamsButton searchParams={searchParams} />
</main>
)
}
......@@ -4,7 +4,8 @@ import { UpdateSearchParamsButton } from '../../../components/UpdateSearchParams
const getRandom = async () => Math.random()
export default async function Page({ searchParams }) {
export default async function Page(props) {
const searchParams = await props.searchParams
const someProp = await getRandom()
return (
......@@ -16,10 +17,7 @@ export default async function Page({ searchParams }) {
</div>
<RefreshButton />
<RevalidateButton />
<UpdateSearchParamsButton
searchParams={await searchParams}
id="modal"
/>
<UpdateSearchParamsButton searchParams={searchParams} id="modal" />
</div>
</dialog>
)
......
import Link from 'next/link'
import { UpdateSearchParamsButton } from '../components/UpdateSearchParamsButton'
export default async function Home({ searchParams }) {
export default async function Home(props) {
const searchParams = await props.searchParams
return (
<main>
<Link href="/refreshing/login">
......@@ -10,7 +11,7 @@ export default async function Home({ searchParams }) {
<div>
Random # from Root Page: <span id="random-number">{Math.random()}</span>
</div>
<UpdateSearchParamsButton searchParams={await searchParams} />
<UpdateSearchParamsButton searchParams={searchParams} />
</main>
)
}
......@@ -4,7 +4,8 @@ import { ServerHtml } from '../../../components/server-html'
export const dynamic = 'force-dynamic'
export default ({ searchParams }) => {
export default async (props) => {
const searchParams = await props.searchParams
return (
<>
<ServerHtml />
......
......@@ -5,7 +5,8 @@ import { ServerHtml } from '../../../components/server-html'
export const dynamic = 'force-static'
export const revalidate = 60
export default ({ searchParams }) => {
export default async (props) => {
const searchParams = await props.searchParams
return (
<>
<ServerHtml />
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment