Closed fridays closed 7 years ago
Noticed it. I will deepen this issue.
This is caused from the nature of the validatorjs passes/fails callbacks:
The package forces to use two calls to the two methods (passes/fails) which is firing the promise 2 time. Maybe I should open an issue on the validatorjs repo.
Oh, that's special! I wonder why it's done like this in validatorjs. Would you better recommend one of the other validation packages?
You can handle async validation with js function (VJF plugin which is enabled by default) and using other DVR rules at the same time if you still want to use validatorjs
Thanks. VJF + chriso's validator work great for me.
You can see this in the demo, uncomment the
console.log
statement here: https://github.com/foxhound87/mobx-react-form-demo/blob/master/src/forms/extension/_.async.js#L12When the value changes, it happens twice:
Any ideas?