Why Use Server Actions?
I can see the benefit of the server component version. Colocated, no need to make an api endpoint in another file.
But isn't the client component version just another way of writing API endpoints?
Guess you can use it in form without javascript:
But using it this way feels sucky as there is no way (that I know of) to make it typesafe.
2 Replies
I can't tell if this question is limited to this specific example or if it's being asked in general why server actions should be used
if the latter, I see it as a great replacement for trpc if you're concerned about type safety and would prefer to limit the number of tools you use and are already using next with the app router
It's like a worst trpc, I really don't see the point of it yet.