We've had this issue multiple times with Typescript where whenever we want to do form.value before submission we end up needing to coalesce every single possibly undefined value. When this should be something that the library should know out of the current state.
We do have form.isValid to check whether the form is currently valid, however that is not enough to make form.value to have its required values to be defined at the type level. Which is fine, there's nothing that is actually informing TS that the form has become valid and the values should be defined.
My initial thought for this is that we probably need another function (or we could rework the form.value getter) that does the validation check and yields the defined values.
We've had this issue multiple times with Typescript where whenever we want to do
form.valuebefore submission we end up needing to coalesce every singlepossibly undefinedvalue. When this should be something that the library should know out of the current state.We do have
form.isValidto check whether the form is currently valid, however that is not enough to makeform.valueto have its required values to be defined at the type level. Which is fine, there's nothing that is actually informing TS that the form has become valid and the values should be defined.My initial thought for this is that we probably need another function (or we could rework the
form.valuegetter) that does the validation check and yields the defined values.