Open tr1s opened 4 years ago
Hey, the issue happens because the <Link />
in the PostLink component should point to a dynamic route.
You can find more info about it in the docs.
Here's a working version:
<Link href="/posts/[postname]" as={`/posts/${post.slug}`}>
<a>{post.frontmatter.title}</a>
</Link>
Ah good call, missing the as
attribute! Ty
Hi!
I just went through your blog post on Netlify and was going to compare what I had just learned on Next's learn-starter blog to see what you both did differently for my own curiosities (still processing).
I noticed though when I clicked a blog post (from post list on the index page) I would get a full-page refresh when going to the blog post. I couldn't see what I did wrong so I came here to clone this repo and I got the same behaviour.
I preserved my logs and this is what I get:
But the post will still show up, but first it get's an error and refreshes.
Do you not get this behaviour? Not quite sure what's up 🤷🏽♂️