TanStackT
TanStack7mo ago
2 replies
progressive-amaranth

How to run the `queryFn` only on the server and not on browser at all?

I was able to do this with server functions and defer the fetching till the component gets mounted (to avoid fetching at initial render), but somehow i get the error -
Nextjs Warning: Cannot update a component (`Router`) while rendering a different component (`Home`). To locate the bad setState() call inside Home
Was this page helpful?