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? |
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 |
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
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.
All reactions