Server page rendering multiple times - slug then being undefined.
Unanswered
Scottish Fold posted this in #help-forum
Scottish FoldOP
I have a simple set up for my nextjs project. (14.1.0)
My file structure is as follows
-app
--[locale]
---[[...slug]]
----page.js
inside this page is this simple code
My issue is that the page renders fine on the browser but in the console it first succeeds then logs lots of params.
The first log is always perfect but after that it then breaks.
I have also set reactStrictMode to false to try and fix but no luck
My file structure is as follows
-app
--[locale]
---[[...slug]]
----page.js
inside this page is this simple code
export default async function Home({params: {locale, slug}}) {
const test = {
locale,
slug
}
console.log(test)
const data = await getData(test)
return (
<MainLayout active={false} global={data.global} locale={locale}>
<Sections sections={data.sections} locale={locale}/>
</MainLayout>
);
}My issue is that the page renders fine on the browser but in the console it first succeeds then logs lots of params.
The first log is always perfect but after that it then breaks.
I have also set reactStrictMode to false to try and fix but no luck