@barguide/react-hooks
Version:
TypeScript | React Hooks
15 lines (14 loc) • 499 B
TypeScript
/// <reference types="react" />
declare type FormInputOnChange = (event: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
interface FormInput {
onChange: FormInputOnChange;
setValue: (val: string) => void;
value: string;
}
/**
* @name useFormInput
* @description A convenience hook for working with text inputs
*/
declare const useFormInput: (initialValue?: string) => FormInput;
export { useFormInput };
export type { FormInputOnChange, FormInput };