-
Sorry for keeping it short, my browser just lost my text from before :( I have the following setup:
And use the
But I could give So my question: Does it make sense to type
What's the best practice here? Thanks! :) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The Next.js docs recommend specifying the keys you're interested in, but since you can technically receive anything, a more correct type would be // page.tsx
import type { SearchParams } from 'nuqs/server'
type PageProps = {
searchParams: SearchParams
}
export default function Page({ searchParams }: PageProps) {
// ...
} |
Beta Was this translation helpful? Give feedback.
The Next.js docs recommend specifying the keys you're interested in, but since you can technically receive anything, a more correct type would be
Record<string, string | string[] | undefined>
, which is conveniently exported bynuqs
: