Are validators not supposed to be defined inside of formOptions?
when using the formOptions I notice type inference doesn't flow into the validators.
However if we ONLY define the default options within formOptions and we define the validators within useAppForm, the inference works.
Is the recommendation to define them there?


6 Replies
other-emerald•6mo ago
Welp
We hit an inherent limitation here
We can either
Allow for the ...formOpts inferencing to work
Or allow formOptions to have validators
I didn't realize that would be a limit but here we are :/
generous-apricotOP•6mo ago
Oh wait if we define them inside useAppForm, assuming the inference won’t flow down into the sub composed forms 🤔
I don’t see how the subforms could know the types for errors defined within useAppForm
other-emerald•6mo ago
WDYM?
Oh
Oh I see
sigh
Can you make a new GH issue with both of these concerns? I think we need to zoom out and figure out how to solve this more sustainably
generous-apricotOP•6mo ago
Yeah I gotchu
Lol sorry I feel like I always just catch downers like this 😂💀
other-emerald•6mo ago
I'd rather it be someone generally supportive and kind like you than some naysayer who's on the "forms are easy" camp haha
So I appreciate it
generous-apricotOP•6mo ago
GitHub
Missing type inference with Validators in formOptions · Issue #1273...
Describe the bug Currently, defining validators within the formOptions function does not allow proper type inference from defaultOptions. To retain type inference, users are forced to define valida...