Query Params
Unanswered
Munchkin posted this in #help-forum
MunchkinOP
How can i get Query Parameters on a layout (server sided)?
Params is null here. How can i get either NextRequest or NextResponse here?
export default function RootLayout(all: any) {
console.log(all.params)
return all.children
}Params is null here. How can i get either NextRequest or NextResponse here?
4 Replies
MunchkinOP
OR from a server side page.
export default function Page({
params,
searchParams,
}: {
params: { slug: string }
searchParams: { [key: string]: string | string[] | undefined }
}) {
return <h1>My Page</h1>
}you can get it with
page.tsxMunchkinOP
Yeah, i just realized. I can't just get it from a layout. Makes sence.