Files
Ammaar Reshi d6025af146 Initial commit
2025-01-04 14:06:53 +00:00

11 lines
389 B
TypeScript

import * as React from 'react';
type UseControllableStateParams<T> = {
prop?: T | undefined;
defaultProp?: T | undefined;
onChange?: (state: T) => void;
};
declare function useControllableState<T>({ prop, defaultProp, onChange, }: UseControllableStateParams<T>): readonly [T | undefined, React.Dispatch<React.SetStateAction<T | undefined>>];
export { useControllableState };