Open ianlet opened 2 months ago
Yes, this is a problem with the current implementation of Modular Forms, which I will fix when I rewrite the library. To satisfy the compiler, you could add features: v.undefined()
wherever features
is not needed. The initial object structure for .loader
is needed to initialize the form store.
Let's say I have the following schema with multiple variants requiring different fields based on the
placeType
field.Here's the simplified version so I can better refer to it below:
I want to use this schema to build a form in Qwik, but I'm having difficulties taming the Typescript compiler because it's always inferring that
features
is anundefined
field ornever
.Here's a minimal example to illustrate this issue:
Which will yield the following errors:
Do you have an (elegant) recommendation on how to satisfy the compiler and let it know that we want a specific variant of the form in that case?