Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

About Link:How could I get Link's href value at server route #5030

Closed
Rukeith opened this issue Aug 25, 2018 · 1 comment
Closed

About Link:How could I get Link's href value at server route #5030

Rukeith opened this issue Aug 25, 2018 · 1 comment

Comments

@Rukeith
Copy link

Rukeith commented Aug 25, 2018

Question about Next.js

I have a Link DOM such as <Link href="/blog/0", as="/blog/ss" />
My server router is like this.

router.get('/blog/:articleId', async (ctx) => {
  await app.render(ctx.req, ctx.res, '/articles', { articleId: ctx.params.articleId });
  ctx.respond = false;
});

How could I get the Link's href value? The ctx.params.articleId which I get is ss.

@timneutkens
Copy link
Member

As you could read in the issue template, questions should be posted on https://spectrum.chat/next-js.

Nonetheless here's an explanation:
#2833 (comment)

In your case href should be /articles?articleId=0

@lock lock bot locked as resolved and limited conversation to collaborators Aug 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants