1 | /**
|
2 | * Given a prop value and state value, the useControllableProp hook is used to determine whether a component is controlled or uncontrolled, and also returns the computed value.
|
3 | *
|
4 | * @see Docs https://chakra-ui.com/docs/hooks/use-controllable#usecontrollableprop
|
5 | */
|
6 | export declare function useControllableProp<T>(prop: T | undefined, state: T): [boolean, T];
|
7 | export interface UseControllableStateProps<T> {
|
8 | value?: T;
|
9 | defaultValue?: T | (() => T);
|
10 | onChange?: (value: T) => void;
|
11 | shouldUpdate?: (prev: T, next: T) => boolean;
|
12 | }
|
13 | /**
|
14 | * The `useControllableState` hook returns the state and function that updates the state, just like React.useState does.
|
15 | *
|
16 | * @see Docs https://chakra-ui.com/docs/hooks/use-controllable#usecontrollablestate
|
17 | */
|
18 | export declare function useControllableState<T>(props: UseControllableStateProps<T>): [T, React.Dispatch<React.SetStateAction<T>>];
|