Socket
Socket
Sign inDemoInstall

react-hook-form

Package Overview
Dependencies
86
Maintainers
1
Versions
1027
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.4.0-beta.5 to 0.4.0-beta.6

10

dist/index.d.ts
declare type Validate = (data: string | number) => boolean | string | number | Date;
declare type NumberOrString = number | string;
declare type Props = {
mode: 'onSubmit' | 'onBlur' | 'onChange';
validationSchema?: any;
};
export interface RegisterInput {

@@ -46,3 +50,2 @@ ref: HTMLInputElement | HTMLSelectElement | null;

}
declare type ValidationSchema = any;
export interface ErrorMessages {

@@ -53,6 +56,3 @@ [key: string]: {

}
export default function useForm({ mode, validationSchema }?: {
mode: 'onSubmit' | 'onBlur' | 'onChange';
validationSchema?: ValidationSchema;
}): {
export default function useForm({ mode, validationSchema }?: Props): {
register: (data: RegisterInput) => void;

@@ -59,0 +59,0 @@ handleSubmit: (callback: (Object: any, e: any) => void) => (e: any) => Promise<void>;

@@ -236,3 +236,2 @@ import { useRef, useState, useEffect } from 'react';

catch (e) {
console.log('yup error', e);
return parseErrorSchema(e);

@@ -341,4 +340,2 @@ }

localErrors = await validateWithSchema(validationSchema, values);
console.log(values);
console.log(localErrors);
if (localErrors === undefined) {

@@ -345,0 +342,0 @@ callback(values, e);

@@ -238,3 +238,2 @@ 'use strict';

catch (e) {
console.log('yup error', e);
return parseErrorSchema(e);

@@ -343,4 +342,2 @@ }

localErrors = await validateWithSchema(validationSchema, values);
console.log(values);
console.log(localErrors);
if (localErrors === undefined) {

@@ -347,0 +344,0 @@ callback(values, e);

@@ -0,1 +1,2 @@

export declare function parseErrorSchema(error: any): any;
export default function validateWithSchema(ValidationSchema: any, data: any): Promise<any>;
{
"name": "react-hook-form",
"version": "0.4.0-beta.5",
"version": "0.4.0-beta.6",
"main": "dist/index.js",

@@ -5,0 +5,0 @@ "module": "dist/index.es.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc