can't use complex validation with `validateOnMount`
See original GitHub issueI’m trying to run a complex validation that relies on other form fields using validateOnMount
. It appears as though the validate
function doesn’t receive the second values
argument when validateOnMount
is enabled.
https://github.com/joepuzzo/informed/blob/master/src/hooks/useField.js#L270 and https://github.com/joepuzzo/informed/blob/master/src/hooks/useField.js#L559
Compare that with the asyncValidateOnMount
implementation which does appear to receive the values
argument - https://github.com/joepuzzo/informed/blob/master/src/hooks/useField.js#L351
A simple reproduction - https://codesandbox.io/s/proud-framework-9txxg?file=/src/MyForm.js
If the solution is as simple as what I’ve laid out, I’m happy to submit a PR with the change, I’m just unsure of any unintended side effects it may cause.
Issue Analytics
- State:
- Created 2 years ago
- Comments:11 (10 by maintainers)
V4 is out! Go check it out
Ok I have solve in V4