k_vasen
k_vasen
Explore posts from servers
KPCKevin Powell - Community
Created by k_vasen on 8/25/2024 in #front-end
Creating a Array of objects from the union type.
Thank you @rik.I'll look for the source code you ts-oss/env
34 replies
KPCKevin Powell - Community
Created by k_vasen on 8/25/2024 in #front-end
Creating a Array of objects from the union type.
Yes kind of that I am looking for
34 replies
KPCKevin Powell - Community
Created by k_vasen on 8/25/2024 in #front-end
Creating a Array of objects from the union type.
Couldn't able to figure out what you're saying. Can you send me the link for any documentation
34 replies
KPCKevin Powell - Community
Created by k_vasen on 8/25/2024 in #front-end
Creating a Array of objects from the union type.
And Gender is an example. Tyring to componentize the sveltekit-superform using Shadcn-svelte
34 replies
KPCKevin Powell - Community
Created by k_vasen on 8/25/2024 in #front-end
Creating a Array of objects from the union type.
yes...
34 replies
KPCKevin Powell - Community
Created by k_vasen on 8/25/2024 in #front-end
Creating a Array of objects from the union type.
No description
34 replies
KPCKevin Powell - Community
Created by k_vasen on 8/25/2024 in #front-end
Creating a Array of objects from the union type.
Baiscally Mapping the Union type into Array of object
34 replies
KPCKevin Powell - Community
Created by k_vasen on 8/25/2024 in #front-end
Creating a Array of objects from the union type.
there should be a error on options prop. since not all Gender options are given
34 replies
KPCKevin Powell - Community
Created by k_vasen on 8/25/2024 in #front-end
Creating a Array of objects from the union type.
If there is a Zod schema like
const schema = z.object({
gender: z.enum(["Male", "Female"])
});
const schema = z.object({
gender: z.enum(["Male", "Female"])
});
and I have to used this gender as a select component in shadcn. Shadcn requires the options to be in the type of {label: string, value: string} . I am exporting a prop which is like
let fieldConfig: FieldConfig<z.infer<typeof schema>> = {
gender: {
options: [] // Here I would like to ensure that the all enum values are given in the shadcn required object format
}
}
let fieldConfig: FieldConfig<z.infer<typeof schema>> = {
gender: {
options: [] // Here I would like to ensure that the all enum values are given in the shadcn required object format
}
}
34 replies
KPCKevin Powell - Community
Created by k_vasen on 8/25/2024 in #front-end
Creating a Array of objects from the union type.
No description
34 replies