Skip to content

Instantly share code, notes, and snippets.

@raynirola
Created December 19, 2022 22:21
Show Gist options
  • Save raynirola/0d58ebdafec28a6009331faee31c9392 to your computer and use it in GitHub Desktop.
Save raynirola/0d58ebdafec28a6009331faee31c9392 to your computer and use it in GitHub Desktop.
type Params<T = Record<string, string>> = T
type SearchParams<T = Record<string, string | string[] | undefined>> = T
interface PageProps<P, S> {
params: Params<P>
searchParams: SearchParams<S>
}
interface LayoutProps<P> {
children: React.ReactNode
params?: Params<P>
}
export interface Page<T = Params, S = SearchParams> extends React.FC<PageProps<T, S>> {}
export interface Layout<T = Params> extends React.FC<LayoutProps<T>> {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment