import { ClientOnly } from './client';
import '../../assets/main.scss';
export function generateStaticParams() {
return [{ slug: [""] }]
}
// Default component
export default function Page() {
return <ClientOnly />;
}
I migrate react.js project into Next.js by referring steps from docs of next.js about migration this is code inside src/app/[[...slug]]/page.js
In this code i am giving static slug which is by default for home page, my project have a admin panel through which i can create a new pages i don't have backend or frontend code of admin panel because it is a CMS type system i am only having with the frontend code of user panel which i am converting in next.js for SEO purpose when i create n new pages every new page has its own unique slug
now the problem is this code only allowing me to go the static slugs like if i want to go to clients page i need to change return [{ slug: ["client"] }] like this
but there are approx 200 pages and there slugs are unknown and new page are going to add it everyday so its obvious i cant put each and every slug statically
so i want to make this code dynamic to take the any slug and if the page with that slug is not in database then 404 page should appear