Next.js Discord

Discord Forum

nested Dynamic route

Unanswered
Polar bear posted this in #help-forum
Open in Discord
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

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
Send first generateStaticParams and or second one
We need all relevant code not just "some" code
@alfonsus ardani Send first generateStaticParams and or second one
Polar bearOP
this is the second one
in the Info dynamic component
Polar bearOP
@Polar bear https://github.com/karim-mev/sad-construct
Polar bearOP
@alfonsus ardani there ya go
the whole tang
Polar bearOP
bump