How to type formOptions
Hy everyone, someone can say me, if it's possible a type formOptions and if yes how to ?
Code :
5 Replies
deep-jade•4w ago
i'm not 100% sure if its the correct way or if its exactly your question, but something like this worked for me with typing my formopts
or do you mean that the formOptions is the type?
vicious-gold•4w ago
The code you sent is a very overcomplicated way of just doing
The much easier approach would be to type your expected values and base the default values off of them:
if you were also looking for the recommended pattern, see the comment above ^
multiple-amethystOP•4w ago
okey so it's not possible with formOptions ?
vicious-gold•4w ago
not only way more complicated, but pointless.
formOptions infers from the types you give it, so if you need the types from formOptions, you can just go to the sourcemultiple-amethystOP•4w ago
ok ty