Replies: 2 comments 2 replies
-
FormKitSchemas are already pretty strongly typed — I think I would need more detail on what artifact you’re trying to extract exactly? |
Beta Was this translation helpful? Give feedback.
0 replies
-
I try to do the same as interface HouseRecord {
houseName:string,
surface:number,
/*...*/
}
type FormKitS<T> = FormKitSchemaNode &
{
name: keyof T
$formkit: string
}
const schema: FormKitS<HouseRecord>[] = [
{
name: 'houseName',
$formkit: 'text',
label: 'name of the house'
},
{
name: 'surface',
$formkit: 'number',
label: 'Surface'
},
/*...*/
] By doing this the |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The idea is simply strongly typing the schema and the name of the inputs field.
I didn't refine it more as I'm not familiar with FormKit schemas and FormKit file field is a bit of pain.
Beta Was this translation helpful? Give feedback.
All reactions