Next.js Discord

Discord Forum

RTK query or fetch

Unanswered
MrMeshky posted this in #help-forum
Open in Discord
I usually use RTK Query on the client side to communicate with the backend in most of my projects.
But for some APIs where I don’t want the backend URL to be exposed, and I want to create a server action (for example, refresh), should I still use fetch along with RTK Query?
Also, what about pages that require ISR?

In your projects, what do you usually use? Do you handle all requests server-side, or not?

2 Replies

I try my best to fetch as much data as possible on server
@Yi Lon Ma I try my best to fetch as much data as possible on server
this ia a good pattern, fetch data server side and pass to client side