🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

@yamada-ui/use-controllable-state

Package Overview
Dependencies
Maintainers
0
Versions
579
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@yamada-ui/use-controllable-state - npm Package Compare versions

Comparing version

to
1.0.22-dev-20241006000212

22

dist/index.d.ts
import { Dispatch, SetStateAction } from 'react';
interface UseControllableStateProps<T> {
value?: T;
defaultValue?: T | (() => T);
onChange?: (value: T) => void;
onUpdate?: (prev: T, next: T) => boolean;
interface UseControllableStateMethods<Y> {
onChange?: (value: Y) => void;
onUpdate?: (prev: Y, next: Y) => boolean;
}
declare const useControllableState: <T>({ value, ...rest }: UseControllableStateProps<T>) => [T, Dispatch<SetStateAction<T>>];
interface UseControllableStateProps<Y> extends UseControllableStateMethods<Y> {
defaultValue?: (() => Y) | Y;
value?: Y;
}
declare function useControllableState<Y>(props: {
value: Y;
defaultValue?: (() => Y) | Y;
} & UseControllableStateMethods<Y>): [Y, Dispatch<SetStateAction<Y>>];
declare function useControllableState<Y>(props: {
defaultValue: (() => Y) | Y;
value?: Y;
} & UseControllableStateMethods<Y>): [Y, Dispatch<SetStateAction<Y>>];
declare function useControllableState<Y>(props: UseControllableStateProps<Y>): [Y, Dispatch<SetStateAction<Y>>];
export { type UseControllableStateProps, useControllableState };

@@ -29,6 +29,6 @@ "use client"

var import_react = require("react");
var useControllableState = ({
function useControllableState({
value,
...rest
}) => {
}) {
var _a;

@@ -52,3 +52,3 @@ (_a = rest.onUpdate) != null ? _a : rest.onUpdate = (prev, next) => prev !== next;

return [resolvedValue, setValue];
};
}
// Annotate the CommonJS export names for ESM import in node:

@@ -55,0 +55,0 @@ 0 && (module.exports = {

{
"name": "@yamada-ui/use-controllable-state",
"version": "1.0.21",
"version": "1.0.22-dev-20241006000212",
"description": "Yamada UI useControllableState custom hook",

@@ -28,3 +28,3 @@ "keywords": [

"dependencies": {
"@yamada-ui/utils": "1.5.2"
"@yamada-ui/utils": "1.5.3-dev-20241006000212"
},

@@ -31,0 +31,0 @@ "devDependencies": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet