canSubmit and isValid is true by default?
#1255
-
|
😕 When I build a simple form with validation and subscribe using I tried adding my validator to https://stackblitz.com/edit/tanstack-form-4xzdhemm?file=src%2Findex.tsx&preset=node |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 9 replies
-
Beta Was this translation helpful? Give feedback.
-
|
@cgatian @paulm17 First up, sorry for the misinformation. Well, not quite—it's kind of related, but unfortunately, I didn't consider how this relates to the React adapter. So far, my suspicions are that the form.mount() is being called, but before it can finish, the useStore is subscribing to the state of the form and logging it out. Now, I don't think this is an issue as the form is not mounted. However, I will admit I don't like the DX... I'll continue to look into this, out of curiosity is this causing issues other than just the init values being logged? Just so I can understand the problems a little better 🤟 As a heads up I deleted my answer as I don't want to confuse anyone thinking this was solved |
Beta Was this translation helpful? Give feedback.
-
|
It seems like this is by design. If so, I believe it will be better if they could give the user the option to either enable or disable this behavior. I am trying to migrate our forms to this form, now that I encountered this, I don't think I can proceed anymore! |
Beta Was this translation helpful? Give feedback.
-
|
Any updates on this? The form submit button should start out disabled. |
Beta Was this translation helpful? Give feedback.
-
|
Would checking for |
Beta Was this translation helpful? Give feedback.



Would checking for
isPristinehelp as a workaround for now? Since the only way to get out of the pristine state is to trigger at least one onChange validation