need help how can i get searchParams in layout
Unanswered
Cuvier’s Dwarf Caiman posted this in #help-forum
![Avatar](https://cdn.discordapp.com/embed/avatars/0.png)
Cuvier’s Dwarf CaimanOP
import { ReactNode } from "react";
export default function Layout({
children,
searchParams,
}: {
children: ReactNode;
searchParams: { [key: string]: string | undefined };
}) {
console.log(searchParams);
return <div className="max-w-3xl mx-auto">{children}</div>;
}
export default function Layout({
children,
searchParams,
}: {
children: ReactNode;
searchParams: { [key: string]: string | undefined };
}) {
console.log(searchParams);
return <div className="max-w-3xl mx-auto">{children}</div>;
}
4 Replies
![Avatar](https://cdn.discordapp.com/embed/avatars/0.png)
Cuvier’s Dwarf CaimanOP
i wont to get searchParams in layout.tsx and this file can not be client side render (if ou have any example then show me)
useSearchParam() is client side hook but i need searchParams in layout.tsx file i can not use this hook in layout.tsx file
![Avatar](https://cdn.discordapp.com/avatars/484037068239142956/f386ac21405ce3442e0f3598223e1cb3.webp?size=256)
joulev
it's impossible to get searchparams in layout.tsx RSC files https://nextjs.org/docs/app/api-reference/file-conventions/layout#layouts-do-not-receive-searchparams