Next.js Discord

Discord Forum

What library to use with form actions?

Unanswered
Harlequin posted this in #help-forum
Open in Discord
HarlequinOP
I feel like the vanilla way of doing for actions lacks a little bit. Are there any good libs to make it easier?

10 Replies

Netherland Dwarf
May i ask what do you to make actions “more easier”? @Harlequin
Do you mean validation or …?
HarlequinOP
i might use zod for validation, but to return and show errors etc
do you have a snippet on how to do it the proper way? there are so many approaches. i need loading spinners etc
Netherland Dwarf
React hook forms you can use
It integrates with zod
And now with next.js 14 you can also use useFormStatus to get the pending state of the form action
React hook form handles all the form input updates and returns the error for each which integrates with zod and shows the zod error
If not then maybe someone else can share their thoughts.