Ready to get started?
Join Adocasts Plus for $8/mo, or sign into an existing Adocasts Plus account, to get access to all of our lessons.
Building with AdonisJS & Inertia #3.2
The useForm Helper
We'll introduce the useForm helper composable provided by InertiaJS. We'll refactor our current form to use the useForm helper instead and see how it can help manage our form state, errors, and submission.
- Created by
- @tomgobich
- Published
Join the Discussion 4 comments
-
Hi! Just wanted to share that a new update for
@adonisjs/inertiahas been released. You no longer need to declareerrorsin the Inertia config, and errors are now returned as a single string instead of an array of strings.5-
Responding to gribbl
Yes, thank you for sharing!! Once completed, we'll be adding a new module to the end of this series covering what's new in Inertia v2 and the AdonisJS adapter and I'll circle back and add/edit some lessons to include notes for outdated things like this.
2
-
-
Just my finding about
@adonisjs/inertiaupdate is that if you are using react and you consume errors viaform.errosyou must send post request usingform.postotherwise (if you userouter.posterrors) it always empty (I think they not sync withprops.errors)1-
Responding to inox
Hi inox! Yes, that's correct! You have to send the request via the
useFormcomposable in order for that composable to be able to digest any validation errors into its state.0
-