© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Drizzle TeamDT
Drizzle Team•7mo ago•
2 replies
Strafe

Using drizzle-zod on zod-based form

Hey guys, just wondering if you have a clean solution to implement useAppForm schema and reuse drizzle-zod exposed schema.

I'm constantly facing null vs. undefined and troubled to find a clean way to reuse select schema.

  const form = useAppForm({
    defaultValues: {
      // environmentId: activeEnvironment?.id ?? "",
      name: "",
      lastName: "",
      email: "",
      mobile: "",
      country: "TH",
      clientReferenceId: "",
    } as CustomerCreateForm,
    validators: {
      onSubmit: CustomerInsertSchema,
    },
    onSubmit: async ({ value }) => {
      await createCustomer(value)
      modal.handleClose()
    },
  })
  const form = useAppForm({
    defaultValues: {
      // environmentId: activeEnvironment?.id ?? "",
      name: "",
      lastName: "",
      email: "",
      mobile: "",
      country: "TH",
      clientReferenceId: "",
    } as CustomerCreateForm,
    validators: {
      onSubmit: CustomerInsertSchema,
    },
    onSubmit: async ({ value }) => {
      await createCustomer(value)
      modal.handleClose()
    },
  })


My schema: https://pastebin.com/raw/7cHUjDXN
Drizzle TeamJoin
The official Discord for all Drizzle related projects, such as Drizzle ORM, Drizzle Kit, Drizzle Studio and more!
11,879Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Using drizzle-zod with superforms
Drizzle TeamDTDrizzle Team / help
7mo ago
Drizzle-Zod
Drizzle TeamDTDrizzle Team / help
9mo ago
Semicolon separated emails using drizzle-zod.
Drizzle TeamDTDrizzle Team / help
16mo ago
Drizzle-zod errors
Drizzle TeamDTDrizzle Team / help
2y ago