4 ms·
I'm confused by this > What’s more, static site builds in both Next.js and Gatsby can’t make use of server-side rendering functionality. I haven't used Next.j
by lopatin 4y ago
I'm confused by this
> What’s more, static site builds in both Next.js and Gatsby can’t make use of server-side rendering functionality.
I haven't used Next.js but I heard that it supports server side rendering, so I assume you can use it kind of like Rails?
Is the issue with Next.js that you would have to remember to use <a> instead of <Link>? That sounds like not a big deal.
- chrisco255 4y agoYeah, Next.js supports both. And the <Link> tag is not required, it's simply recommended, as the Link tag has built-in prefetching, so users will feel a small performance boost from local links that use it.
- Jcampuzano2 4y agoUse a <Link /> if you want prefetching and client-side transitions, use just an <a /> if you want to opt out of that. It also sounds like the author is complaining about Next.js/Gatsby not having an option that doesn't even make sense in the first place. "static site builds in both Next.js and Gatsby can’t make use of server-side rendering functionality" - What does this even mean? Of course a static site build won't have SSR.
- kall 4y agoIt is confusing because between all the different levels of being static or server side rendered or client side rendered, next.js can pretty much do (and potentially mix) them all, right? I'm quite confused on _why_ they want next to act like this? You can use anchor tags to force a browser navigation, but what does it get you? You're still loading JS bundles and it's not like <Link /> breaks anything like history or open in new tab. People put turbolinks in their rails app to get something that works half as well. You could also use unstable_disableRuntimeJs on some pages and your <Link /> will still fully degrade to act like a completely server rendered page.