![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
react-hook-form-zod
Advanced tools
react-hook-form-zod is a library that combines react-hook-form and zod to create forms with validation.
Its primary purpose is to reduce the boilerplate required to use zod with react-hook-form.
npm install react-hook-form-zod zod
yarn add react-hook-form-zod zod
pnpm add react-hook-form-zod zod
WITHOUT react-hook-form-zod:
import { useForm } from "react-hook-form";
import { zodResolver } from "@hookform/resolvers/zod";
import { z } from "zod";
const schema = z.object({
name: z.string().min(3).max(10),
age: z.number().min(18),
});
type FormValues = z.infer<typeof schema>;
function Form() {
const form = useForm<FormValues>({
resolver: zodResolver(schema),
});
// ...
}
WITH react-hook-form-zod:
import { useForm } from "react-hook-form-zod";
import { z } from "zod";
const schema = z.object({
name: z.string().min(3).max(10),
age: z.number().min(18),
});
function Form() {
const form = useForm({
schema,
});
// ...
}
The API is identical to react-hook-form with the exception of the useForm
hook.
useForm
takes three additional options which correspond to the arguments of the zodResolver
factory function:
schema
: a zod schema (required)schemaOptions
: options for the zod schemafactoryOptions
: options for the hookform resolver factoryFAQs
Typesafe forms with React Hook Form and Zod
The npm package react-hook-form-zod receives a total of 180 weekly downloads. As such, react-hook-form-zod popularity was classified as not popular.
We found that react-hook-form-zod demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.