I'm building a simple donation app in ReactJS. Here is a working version here: https://stackblitz.com/edit/react-grzdgz
I've never done form error validation though. So if someone doesn't fill out a field, I'd like an error message to pop up, which says something like "this field must be completed".
I've been trying to follow this tutorial: https://learnetto.com/blog/how-to-do-simple-form-validation-in-reactjs
But I'm kinda getting lost, about how I can pass these functions/error messages, into my form, which sits in a seperate module. In the demo, everything sits in one file.
But in my app, my form sits seperately to index.js. So I link to it in index.js.
I'm almost there, I just need some help connecting everything up.
Can anyone help me get form error validation working?
The error handling functions all sit here: https://stackblitz.com/edit/react-grzdgz
The form itself sits here: https://stackblitz.com/edit/react-grzdgz?file=components%2FForm.js
And some form errror heres: https://stackblitz.com/edit/react-grzdgz?file=components%2FFormErrors.js
Any help would be great! Thank you!