TheSpik3
Explore posts from serversHow to render single component on server to HTML
Hi, is there any way to render single component to HTML on server? Something like https://react.dev/reference/react-dom/server/renderToStaticMarkup does?
4 replies
SWR on Vercel
Hi, I'm trying to setup SWR site on Vercel. The problem is I keep seeing requests to API being made, when navigating using NuxtLink. I did set payloadExtraction to true, but it doesn't seem to help.
Here is the config:
experimental: {
payloadExtraction: true
},
routeRules: {
// all routes (by default) will be revalidated every 60 seconds, in the background
'/**': { swr: 60 }
}
I do this, because there is an external API, that I call by /api/* in Nuxt app and it is very slow (1-2s response time). I would like my page to be fast - it would make sense to regenerate it once in a while (now it's set to 60 sec for testing), since that data isn't updated very often, but I keep getting no data, when requests are made again on client side. I guess this happens, because I use query parameters, that are undefined
with SWR enabled (but that request shouldn't go through anyway right?).2 replies