DEV Community

loading...

How do you do validations with ReactJs forms?

Vicente G. Reyes
Building Indiependent.to | ICVN Tech Studio | Musician | https://t.co/IR2ZEbjzm5 | https://digest.icvn.tech
・1 min read

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.