vantezzen / auto-form

🌟 A React component that automatically creates a @shadcn/ui form based on a zod schema.
https://vantezzen.github.io/auto-form/
2.27k stars 81 forks source link

The label and value are the same when using nativeEnum #74

Open JIASENG126 opened 2 months ago

JIASENG126 commented 2 months ago

To begin, I want to express my gratitude for the chance to propose enhancements to this project!

Description:

I've observed that when utilizing nativeEnum, the values for label and value coincide. Furthermore, I believe it would be advantageous if radio-group could also accommodate the label and value format.

Changes Made:

andrewdoro commented 2 months ago

Wouldn't this change break the default zod enum?

vantezzen commented 2 months ago

Yes I feel like this would break the zod validation as the zod enum uses the value only?

Keep in mind that zod will validate and return the enum labels, not the enum values!