vazco / uniforms

A React library for building forms from any schema.
https://uniforms.tools
MIT License
1.95k stars 240 forks source link

zod "lazy" support #1327

Open helt opened 5 months ago

helt commented 5 months ago

When having zod schemas that make use of z.lazy(), form generation fails.

export const colorMappingSchema = z
  .object({ attribute: z.string(), colorMap: z.string() })

export const errorWithLazy = z.object({
  color: z.lazy(() => colorMappingSchema), // will fail here
  name: z.string(),
})

Used versions:

├─┬ uniforms-bridge-zod@4.0.0-alpha.5
├─┬ uniforms-mui@4.0.0-alpha.5
└── uniforms@4.0.0-alpha.5