With Server Actions, do we still need to use API Routes?
Answered
Grass carp posted this in #help-forum
Grass carpOP
With Server Actions, do we still need to use API Routes when fetching data on then client? Or is it that API Routes are still more appropriate for most use cases?
Answered by riský
server actions create their own api routes... if you still want 3rd parites to use your website, you should still create them... server actions are really good for your website, but not so food for others
4 Replies
server actions create their own api routes... if you still want 3rd parites to use your website, you should still create them... server actions are really good for your website, but not so food for others
Answer
@riský server actions create their own api routes... if you still want 3rd parites to use your website, you should still create them... server actions are really good for your website, but not so food for others
Grass carpOP
OK. I'm still a beginner, thank you for your answer.😆
you should also read the docs (and potentially the linked vid) to get a greater understanding: https://nextjs.org/docs/app/building-your-application/data-fetching/forms-and-mutations
and imo, as they are experimental, you may be better off not using them until you have a decent grasp on nextjs as they can have a higher chance of bugs (but that doesn't mean they are bad)