@react-component-library/utils
Version:
A collection of utility hooks and components tailored to streamline React application development.
9 lines (8 loc) • 340 B
TypeScript
import { Dispatch, SetStateAction } from 'react';
interface UseControlledStateProps<T> {
initialState: T;
value: T | undefined;
setValue: Dispatch<SetStateAction<T>> | undefined;
}
declare const useControlledState: <T>(options: UseControlledStateProps<T>) => [T, Dispatch<SetStateAction<T>>];
export default useControlledState;