Using next as a frontend
Answered
Russian Blue posted this in #help-forum
Russian BlueOP
What is the proper way of fetching using Next. For get requests, is it still fine to fetch directly in server components? And for POST requests, how should I handle the fetches to my Rest API?
Answered by Northern Wheatear
You can either use fetch function as it is to send post requests, use a library like SWR or Tanstack Query (React Query) or you can create a server action and make post req that way also
2 Replies
Northern Wheatear
You can either use fetch function as it is to send post requests, use a library like SWR or Tanstack Query (React Query) or you can create a server action and make post req that way also
Answer
Russian BlueOP
Alright deal, thanks!