
Research
PyPI Package Disguised as Instagram Growth Tool Harvests User Credentials
A deceptive PyPI package posing as an Instagram growth tool collects user credentials and sends them to third-party bot services.
@hookform/resolvers
Advanced tools
React Hook Form validation resolvers: Yup, Joi, Superstruct, Zod, Vest, Class Validator, io-ts, Nope, computed-types, TypeBox, arktype, Typanion, Effect-TS and VineJS
The @hookform/resolvers package is used in conjunction with React Hook Form to integrate external validation libraries. It provides resolvers that allow you to use your preferred validation schema with React Hook Form, ensuring that form data adheres to certain rules before it is processed or submitted.
Yup Resolver
Integrates Yup validation schema with React Hook Form.
{"import { yupResolver } from '@hookform/resolvers/yup';\nimport * as yup from 'yup';\n\nconst schema = yup.object().shape({\n name: yup.string().required(),\n age: yup.number().positive().integer().required(),\n});\n\nconst { register, handleSubmit, errors } = useForm({\n resolver: yupResolver(schema)\n});\n\n// In your form...\n<input name='name' ref={register} />\n<p>{errors.name?.message}</p>\n<input name='age' ref={register} />\n<p>{errors.age?.message}</p>"}
Joi Resolver
Integrates Joi validation schema with React Hook Form.
{"import { joiResolver } from '@hookform/resolvers/joi';\nimport Joi from 'joi';\n\nconst schema = Joi.object({\n username: Joi.string().alphanum().min(3).max(30).required(),\n password: Joi.string().pattern(new RegExp('^[a-zA-Z0-9]{3,30}$')),\n});\n\nconst { register, handleSubmit, errors } = useForm({\n resolver: joiResolver(schema)\n});\n\n// In your form...\n<input name='username' ref={register} />\n<p>{errors.username?.message}</p>\n<input name='password' ref={register} />\n<p>{errors.password?.message}</p>"}
Zod Resolver
Integrates Zod validation schema with React Hook Form.
{"import { zodResolver } from '@hookform/resolvers/zod';\nimport { z } from 'zod';\n\nconst schema = z.object({\n firstName: z.string().min(1, { message: 'First name is required' }),\n age: z.number().min(10, { message: 'Minimum age is 10' }),\n});\n\nconst { register, handleSubmit, errors } = useForm({\n resolver: zodResolver(schema)\n});\n\n// In your form...\n<input name='firstName' ref={register} />\n<p>{errors.firstName?.message}</p>\n<input name='age' ref={register} />\n<p>{errors.age?.message}</p>"}
React Hook Form is the core library that @hookform/resolvers is designed to work with. It provides a way to manage forms with minimal re-rendering, but it does not include built-in schema-based validation. @hookform/resolvers complements it by adding this capability.
Formik is another popular form management library for React. It handles form state, validation, and submission. Unlike React Hook Form, Formik includes built-in support for Yup validation without needing an additional resolver package.
Redux Form is a form library that works with Redux for state management. It includes validation functionalities but is generally considered heavier and more complex than React Hook Form and requires Redux to be part of the project.
FAQs
React Hook Form validation resolvers: Yup, Joi, Superstruct, Zod, Vest, Class Validator, io-ts, Nope, computed-types, TypeBox, arktype, Typanion, Effect-TS and VineJS
The npm package @hookform/resolvers receives a total of 5,311,131 weekly downloads. As such, @hookform/resolvers popularity was classified as popular.
We found that @hookform/resolvers demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers 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.
Research
A deceptive PyPI package posing as an Instagram growth tool collects user credentials and sends them to third-party bot services.
Product
Socket now supports pylock.toml, enabling secure, reproducible Python builds with advanced scanning and full alignment with PEP 751's new standard.
Security News
Research
Socket uncovered two npm packages that register hidden HTTP endpoints to delete all files on command.