formAPI's onChange doesn't seem to be called at all and it expects the same return type as fieldAPI's onChange. If we want to allow doing validation at the form level in onChange, we probably need it to return a mapping of errors per field (same with onBlur and async methods). Here is a repro of this.
Check the console: nothing is logged despite console.log("****onChange called!"); inside onChange()
Expected behavior
"****onChange called!" should be logged in the console.
Also, onChange returns "An error!" and I'm not sure what should happen with it. It could make more sense to return a mapping of errors per field.
Describe the bug
formAPI's onChange doesn't seem to be called at all and it expects the same return type as fieldAPI's onChange. If we want to allow doing validation at the form level in onChange, we probably need it to return a mapping of errors per field (same with onBlur and async methods). Here is a repro of this.
Your minimal, reproducible example
https://codesandbox.io/p/sandbox/determined-mayer-yn4qfc?file=%2Fsrc%2Findex.tsx%3A43%2C29
Steps to reproduce
console.log("****onChange called!");
insideonChange()
Expected behavior
"****onChange called!" should be logged in the console. Also, onChange returns "An error!" and I'm not sure what should happen with it. It could make more sense to return a mapping of errors per field.
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
Tanstack Form adapter
react-form
TanStack Form version
0.4.2
TypeScript version
No response
Additional context
No response