fetch from server or client Component
Unanswered
Asian black bear posted this in #help-forum
Asian black bearOP
which one should I fetch from? if I want to fetch from my api router
15 Replies
if u have a route handler u fetch from clientside only
Asian black bearOP
yeah why?
is it because it overloads server something like that?
Asian black bearOP
btw I have to get cookies
no because fetching your own route handler trough a ssr component will brake on production
and its not recommended
use this
u can use this anywhere on the server and that is part on the request context
Asian black bearOP
well then I should use server for cookies and client for fetching?
u can fetch from serverside
just make sure u dont fetch your own route handler
on the server
while on client u can do that
Asian black bearOP
oh thank you bro!