Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TS - Form value type does not reflect the runtime value #14

Open
lakardion opened this issue May 8, 2023 · 0 comments
Open

TS - Form value type does not reflect the runtime value #14

lakardion opened this issue May 8, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@lakardion
Copy link
Member

lakardion commented May 8, 2023

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.

@lakardion lakardion added the enhancement New feature or request label May 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant