Skip to content

Commit c1597eb

Browse files
committed
fix: remove NextPage type from App Router pages
NextPage is a Pages Router type and fails App Router page type-checking ('exported Page component isn't correctly typed'). Surfaced once the build actually reached type-checking after the CI runner/timeout fix.
1 parent 189fe29 commit c1597eb

3 files changed

Lines changed: 5 additions & 6 deletions

File tree

app/favorite/page.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
'use client'
2-
import { NextPage } from 'next'
32
import { useFavorite } from '../../src/hooks/useLocalStorage'
43
import { Redirect } from '../lib/redirect'
54

6-
const IndexPage: NextPage = () => {
5+
const IndexPage = () => {
76
const [favorite] = useFavorite()
87

98
return <Redirect path={favorite} />

app/p/[pid]/[bid]/page.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
'use client'
22

3-
import { NextPage } from 'next'
43
import Link from 'next/link'
54
import { useRouter, useSearchParams } from 'next/navigation'
65
import { useEffect } from 'react'
@@ -63,8 +62,10 @@ const IndexPageQueryLoaded = ({
6362
)
6463
}
6564

66-
const IndexPage: NextPage<{ params: { pid: string; bid?: string } }> = ({
65+
const IndexPage = ({
6766
params: { pid, bid },
67+
}: {
68+
params: { pid: string; bid?: string }
6869
}) => {
6970
const [registerTask, loading] = useQueryId({ pid, bid })
7071

app/page.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
import { NextPage } from 'next'
21
import { redirect } from 'next/navigation'
32

4-
const IndexPage: NextPage = () => {
3+
const IndexPage = () => {
54
redirect('/p/tdu')
65

76
return <div />

0 commit comments

Comments
 (0)