How does href in Link work? #14545
-
Beta Was this translation helpful? Give feedback.
Answered by
jamesmosier
Jun 26, 2020
Replies: 1 comment
-
I think what you are seeing when you have an "incorrect" |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Seybo
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think what you are seeing when you have an "incorrect"
href
likehref="projects/[bar]"
is that sincenext/link
can't find that route it just default to theas
value and just navigates to that url like any normal<a href>
would do. If you look at your console you'll see a 404 for the prefetch ofprojects/[bar]
. Normally when using next/link with the correcthref
it would do a client side render but in this case it does a full page refresh because Next can't find that page in the pages folder.