Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

defining component layout next ts

import { NextPage } from 'next'
import { ComponentType, ReactElement, ReactNode } from 'react'

export type Page<P = {}> = NextPage<P> & {
  // You can disable whichever you don't need
  getLayout?: (page: ReactElement) => ReactNode
  layout?: ComponentType
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #defining #component #layout #ts
ADD COMMENT
Topic
Name
2+4 =