Next.js Discord

Discord Forum

Is it okay to use server actions with API endpoint?

Unanswered
Mawhadmd posted this in #help-forum
Open in Discord
For example on register, i want to use the UseFormState hook to make the form interactive (loading, errors, etc..), but the only way to do it (as far as i know) is to create a useFormState or manually onSubmit/onClick... is it okay to create the server action just for this?

4 Replies

server action is not meant for client side modifications
You can use create a regular function and do it all there
Rhinelander
Yes, as far as I know that is how you do it.