fix: await params in Next.js 16 routes and pages for TypeScript compatibility
This commit is contained in:
@@ -10,7 +10,9 @@ interface PageProps {
|
||||
}
|
||||
|
||||
export default async function PlayerProfilePage({ params }: PageProps) {
|
||||
const playerId = parseInt(params.id, 10)
|
||||
// Next.js 16 requires awaiting params
|
||||
const { id } = await params
|
||||
const playerId = parseInt(id, 10)
|
||||
|
||||
if (isNaN(playerId)) {
|
||||
notFound()
|
||||
|
||||
@@ -10,7 +10,9 @@ interface PageProps {
|
||||
}
|
||||
|
||||
export default async function PlayerSchedulePage({ params }: PageProps) {
|
||||
const playerId = parseInt(params.id, 10)
|
||||
// Next.js 16 requires awaiting params
|
||||
const { id } = await params
|
||||
const playerId = parseInt(id, 10)
|
||||
|
||||
if (isNaN(playerId)) {
|
||||
notFound()
|
||||
|
||||
Reference in New Issue
Block a user