-
Notifications
You must be signed in to change notification settings - Fork 231
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
Using href directly in Link #21
Comments
Hey, I can't reproduce. It should not do a full page navigation. Can you show some example code? |
Without add Cheers :) |
I'm also curious if full urls are supported. For example, I might display an anchor tag on my application that contains the full url to a page on my site. Can i use that directly with Link and avoid a full page reload? Since I've got the full url, it would be harder to determine the |
When using only <Link route='detail' params={{id: 123}}><a>Detail</a></Link> Alternatively next.js lets you decorate the displayed URL in any way, but you need to tell it which page to render and pass the params. That's what next-routes normally does for you. You can do it manually like this: <Link href='/detail?id=123' as='/this-can-be-anything'><a>Detail</a></Link> Check out the docs here: https://github.com/zeit/next.js#with-link Hope it helps! |
Thanks for the detailed walk-through! I now understand better. However, I have a use case where a component would render a url link that goes to anywhere including external sites. Example: Im wondering if I can supply the url value directly in the link component, be it with next routes or without. For the first case, I want to be able to navigate without a reload. In the second case, the site would navigate out externally. Cheers :) |
@fridays |
@Rukeith You can get the query by writing a piece of code in your pages:
|
Update dependency typescript to v3.1.6
Hi, I have a url that is part of the data. I tried using the href value directly instead of
params
androute
but it seems to be doing a full page navigation. Is it expected?The text was updated successfully, but these errors were encountered: