Skip to content

Instantly share code, notes, and snippets.

View runewolf7's full-sized avatar
:electron:
Building awesome things at Vercel

Chris Hahn runewolf7

:electron:
Building awesome things at Vercel
View GitHub Profile
@Pagebakers
Pagebakers / create-page.tsx
Last active March 24, 2025 11:54
Next.js createPage helper with loader pattern
import { AnyZodObject, z } from 'zod'
import { Metadata, ResolvingMetadata } from 'next'
type InferParams<Params> = Params extends readonly string[]
? {
[K in Params[number]]: string
}
: Params extends AnyZodObject
? z.infer<Params>
: unknown