setting defaultState.canSubmit to false does not work
I've set the
defaultState.canSubmit
to false
but it doesn't seem to have any effect.
https://stackblitz.com/edit/tanstack-form-g4x5nj?file=src%2Findex.tsx (Line 20)
Is there another way to disable the submit button by default and only enable it once all fields have been touched (and are valid) - probably check state.isTouched
?3 Replies
correct-apricot•13mo ago
You shouldn't manually set
canSubmit
as it's overridden by the formconscious-sapphireOP•13mo ago
Shoudn't it be omitted as an option to set in the
defaultState
-Object then?correct-apricot•13mo ago
I think this pretty much applies for the entire defaultState object in general, it is undocumentend and shouldn't be manually changed but it is used internally and for testing purposes