Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update params of PageProps to string map #41677

Merged
merged 5 commits into from Oct 23, 2022
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 10 additions & 3 deletions packages/next/build/webpack/plugins/flight-types-plugin.ts
Expand Up @@ -25,8 +25,15 @@ type TEntry = typeof entry

check<IEntry, TEntry>(entry)

type PageProps = { params?: any }
type LayoutProps = { children: React.ReactNode; params?: any }
type PageParams = Record<string, string>
interface PageProps {
params?: PageParams
searchParams?: Record<string, string | string[]>
}
interface LayoutProps {
children: React.ReactNode
params?: PageParams
}

type PageComponent = (props: PageProps) => React.ReactNode | null
type LayoutComponent = (props: LayoutProps) => React.ReactNode | null
Expand All @@ -39,7 +46,7 @@ interface IEntry {
}
config?: {}
Head?: any
generateStaticParams?: (params?:any) => Promise<any[]>
generateStaticParams?: (params?: PageParams) => Promise<any[]>
revalidate?: RevalidateRange<TEntry> | false
dynamic?: 'auto' | 'force-dynamic' | 'error' | 'force-static'
dynamicParams?: boolean
Expand Down