How to clear field errors onChange?
Hello! đź‘‹
I’m using TanStack Form for the first time and trying to achieve the following validation flow:
1. User types into a field.
2. Validation runs only on blur.
3. If there’s an error, and the user starts typing again, the error should clear immediately (on change).
4. On the next blur, validation should re-run.
I tried resetting the error by returning undefined from the
onChange
validator, but it doesn’t seem to have any effect. Is there a recommended way to clear field errors when the user starts typing?
Here’s a simplified example that I've tried (without success):
Any ideas on how to reset the error state correctly on change?
Thanks! 🙏1 Reply
rare-sapphire•2mo ago
I think you need to throw
field.listeners.onChange
into the mix to clear errors again (3.)