System Information
- Strapi Version: v5
- Operating System:
- Database:
- Node Version:
- NPM Version:
- Yarn Version:
Hi Guys,
I am building website using strapi v5 and next.js v15.0.3.
This is my main layout file:
type Params = Promise<{ lang: Locales }>;
export default async function RootLayout({
children,
params,
}: {
children: React.ReactNode;
params: Params;
}) {
const { lang } = await params;
return (
<html lang={lang}>
<body
// className={`${geistSans.variable} ${geistMono.variable} antialiased`}
>
<main>
<LangContextProvider langFromRouter={lang}>
{children}
</LangContextProvider>
</main>
</body>
</html>
);
}
In some nested component which now is a server component I am getting the strapi data using query with filter
locale: 'xx',
I want to pass deeper lang variable and replace ‘xx’ with it. The thing is I do not want to mess the code of this component with ‘use client’ and expose the query to the client. Here is the question to more experienced members. What is the best way to achieve this?