uncontrollable
Advanced tools
Comparing version 7.1.0 to 7.1.1
@@ -1,3 +0,5 @@ | ||
declare type Handler<TProp> = (nextValue: TProp, ...args: any[]) => any; | ||
export declare function useUncontrolledProp<TProp, THandler extends Handler<TProp> = Handler<TProp>>(propValue: TProp | undefined, defaultValue: TProp | undefined, handler?: THandler): readonly [TProp | undefined, THandler]; | ||
export declare type Handler = (...args: any[]) => any; | ||
declare function useUncontrolledProp<TProp, THandler extends Handler = Handler>(propValue: TProp | undefined, defaultValue: TProp, handler?: THandler): readonly [TProp, THandler]; | ||
declare function useUncontrolledProp<TProp, THandler extends Handler = Handler>(propValue: TProp | undefined, defaultValue?: TProp | undefined, handler?: THandler): readonly [TProp | undefined, THandler]; | ||
export { useUncontrolledProp }; | ||
declare type FilterFlags<Base, Condition> = { | ||
@@ -11,2 +13,1 @@ [Key in keyof Base]: NonNullable<Base[Key]> extends Condition ? Key : never; | ||
export default function useUncontrolled<TProps extends object, TDefaults extends string = never>(props: TProps, config: ConfigMap<TProps>): Omit<TProps, TDefaults>; | ||
export {}; |
@@ -1,3 +0,5 @@ | ||
declare type Handler<TProp> = (nextValue: TProp, ...args: any[]) => any; | ||
export declare function useUncontrolledProp<TProp, THandler extends Handler<TProp> = Handler<TProp>>(propValue: TProp | undefined, defaultValue: TProp | undefined, handler?: THandler): readonly [TProp | undefined, THandler]; | ||
export declare type Handler = (...args: any[]) => any; | ||
declare function useUncontrolledProp<TProp, THandler extends Handler = Handler>(propValue: TProp | undefined, defaultValue: TProp, handler?: THandler): readonly [TProp, THandler]; | ||
declare function useUncontrolledProp<TProp, THandler extends Handler = Handler>(propValue: TProp | undefined, defaultValue?: TProp | undefined, handler?: THandler): readonly [TProp | undefined, THandler]; | ||
export { useUncontrolledProp }; | ||
declare type FilterFlags<Base, Condition> = { | ||
@@ -11,2 +13,1 @@ [Key in keyof Base]: NonNullable<Base[Key]> extends Condition ? Key : never; | ||
export default function useUncontrolled<TProps extends object, TDefaults extends string = never>(props: TProps, config: ConfigMap<TProps>): Omit<TProps, TDefaults>; | ||
export {}; |
@@ -10,3 +10,4 @@ import _extends from "@babel/runtime/helpers/esm/extends"; | ||
import * as Utils from './utils'; | ||
export function useUncontrolledProp(propValue, defaultValue, handler) { | ||
function useUncontrolledProp(propValue, defaultValue, handler) { | ||
var wasPropRef = useRef(propValue !== undefined); | ||
@@ -39,2 +40,4 @@ | ||
} | ||
export { useUncontrolledProp }; | ||
export default function useUncontrolled(props, config) { | ||
@@ -41,0 +44,0 @@ return Object.keys(config).reduce(function (result, fieldName) { |
{ | ||
"name": "uncontrollable", | ||
"version": "7.1.0", | ||
"version": "7.1.1", | ||
"description": "Wrap a controlled react component, to allow specific prop/handler pairs to be uncontrolled", | ||
@@ -44,3 +44,3 @@ "author": { | ||
"homepage": "https://github.com/jquense/uncontrollable#readme", | ||
"_id": "uncontrollable@7.0.2" | ||
"_id": "uncontrollable@7.1.0" | ||
} |
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
36067
530