Next.js Discord

Discord Forum

nested Dynamic route

Unanswered
Polar bear posted this in #help-forum
Open in Discord
Avatar
Polar bearOP
I'm trying to do generate static Params, I have the following /categories/[category]/[info] the first dynamic route [category] gets generated fine but the second one doesn't for some reasons

12 Replies

Avatar
Polar bearOP
here's some code
export async function generateStaticParams() {
 
  return servicesInfo.map((info) => ({
    info: info.id,
  }))
}
export default async function Info({ params }: { params: { info: string } }) {
  const sth = servicesInfo.find((service) => service.id == params.info);
  return (
    <div className="min-h-screen px-4 lg:px-20 py-20 lg:py-32">
the [info] dynamic route isn't getting statically generated, for those who are wondering I'm fetching from a Json file
Avatar
Send first generateStaticParams and or second one
We need all relevant code not just "some" code
Avatar
Polar bearOP
this is the second one
in the Info dynamic component
Avatar
Polar bearOP
@Alfonsus Ardani there ya go
the whole tang
Avatar
Polar bearOP
bump