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.29k stars 81 forks source link

isRequired is not correct #31

Closed WangLarry closed 9 months ago

WangLarry commented 9 months ago
        const isRequired =
          zodInputProps.required ??
          fieldConfigItem.inputProps?.required ??
          false;

  ------------->
       const isRequired =
          zodInputProps.required  ||
          fieldConfigItem.inputProps?.required ||
          false;

a = b ?? c ?? means : if b is null or undefined then c, not include 'false'