Skip to content
Discussion options

You must be logged in to vote

You need to set the href prop to the "real file" and use the as prop to fill in the variables, see https://nextjs.org/docs/api-reference/next/link#dynamic-routes

So in your case something like

<Link href="/[model]/[slug]" as={`/${props.model}/${props.slug}`}>

should work as it now routes to [model]/[slug].js file.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@farouk46015
Comment options

@timneutkens
Comment options

@farouk46015
Comment options

Answer selected by farouk46015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
3 participants