You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am currently finding it hard to work with Tanstack Form when it comes to unmounted fields and error handling. I have errors for fields within onSubmitAsync that are not currently visible, but still need to be validated against - I can explain this use-case a bit more in detail if need be, but this is required in my case.
The current implementation of validateSync and validateAsync only map over the current fields within the fieldMeta state when applying errors, which in my case, ignores some errors trying to be applied as they may not have had their fields mounted to the DOM yet, and therefore are not included within the fieldMeta state. My only workaround is to manually call setFieldMeta using the formApi variable given for the form validator callbacks, but it does seem like I am missing out on a lot of internal checks and state changes that could be internally affecting my form in ways that I cannot see.
Just want to hear a maintainers thoughts surrounding this decision and could this be adapted at all?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am currently finding it hard to work with Tanstack Form when it comes to unmounted fields and error handling. I have errors for fields within
onSubmitAsync
that are not currently visible, but still need to be validated against - I can explain this use-case a bit more in detail if need be, but this is required in my case.The current implementation of
validateSync
andvalidateAsync
only map over the current fields within thefieldMeta
state when applying errors, which in my case, ignores some errors trying to be applied as they may not have had their fields mounted to the DOM yet, and therefore are not included within thefieldMeta
state. My only workaround is to manually callsetFieldMeta
using theformApi
variable given for the form validator callbacks, but it does seem like I am missing out on a lot of internal checks and state changes that could be internally affecting my form in ways that I cannot see.Just want to hear a maintainers thoughts surrounding this decision and could this be adapted at all?
Beta Was this translation helpful? Give feedback.
All reactions