Skip to content

Commit

Permalink
Use the same generics as NextPage
Browse files Browse the repository at this point in the history
  • Loading branch information
davewelsh committed Jan 25, 2022
1 parent e3d09f5 commit 16d8255
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/basic-features/layouts.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,12 @@ import type { ReactElement, ReactNode } from 'react'
import type { NextPage } from 'next'
import type { AppProps } from 'next/app'

type NextPageWithLayout<T = void> = NextPage<T> & {
type NextPageWithLayout<P = {}, IP = P> = NextPage<P, IP> & {
getLayout?: (page: ReactElement) => ReactNode
}

type AppPropsWithLayout = AppProps & {
Component: NextPageWithLayout<unknown>
Component: NextPageWithLayout
}

export default function MyApp({ Component, pageProps }: AppPropsWithLayout) {
Expand Down

0 comments on commit 16d8255

Please sign in to comment.