use-form-input
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -1,2 +0,2 @@ | ||
import * as React from "react"; | ||
import * as React from 'react'; | ||
declare type ErrorType<T> = { | ||
@@ -18,3 +18,3 @@ [key in keyof T]: { | ||
{ | ||
onChange: (name: keyof T, value?: ValueType | ((previousValue: ValueType) => any)) => (event?: any) => void; | ||
onChange: (name: keyof T, value?: ValueType | ((previousValue: ValueType) => any)) => (event?: React.ChangeEvent<any>) => void; | ||
validator: ValidatorType<T>; | ||
@@ -21,0 +21,0 @@ isValid: (errors: ErrorType<T> | {}) => boolean; |
@@ -30,2 +30,3 @@ Object.defineProperty(exports, '__esModule', { value: true }); | ||
return function (event) { | ||
event === null || event === void 0 ? void 0 : event.persist(); | ||
setData((prev) => { | ||
@@ -37,3 +38,3 @@ var _a; | ||
else { | ||
if (typeof value === "function") { | ||
if (typeof value === 'function') { | ||
const functionReturnValue = value(prev[name]); | ||
@@ -40,0 +41,0 @@ return Object.assign(Object.assign({}, prev), { [name]: functionReturnValue }); |
{ | ||
"name": "use-form-input", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "Simple hook to provide form validation in react", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12990
107