DEV Community

Vicente G. Reyes
Vicente G. Reyes

Posted on

How do you do validations with ReactJs forms?

I've been receiving spammy, real-user submitted form submissions on my site https://studio.icvn.tech/#contact. As a new dev who's been learning react, I find it hard to block free emails on my form.

Does anyone know a solution?

Code is at https://github.com/icvntechstudio/rebrand/blob/master/src/components/Contact.js

Thanks!

Discussion (5)

Collapse
faks profile image
Oskars Germovs

Could integrate some validation library and validate the form.

Collapse
highcenburg profile image
Vicente G. Reyes Author

Any suggestions on a validation library?

Collapse
faks profile image
Oskars Germovs • Edited

Hi, Vincente, the first that comes to mind is validate.js, then maybe React Hook Form, there are more but currently can't remember them :).
dev.to/narendersaini32/top-react-f...

Collapse
highcenburg profile image
Vicente G. Reyes Author

Hi Erick, thanks for answering. The bots are already stopped by hcaptcha. What I'm trying to do is to stop free emails from being submitted to the form.