UNPKG

929 BTypeScriptView Raw
1import * as React from 'react';
2import { UseInputProps } from './InputUnstyledProps';
3export default function useInput(props: UseInputProps, inputRef?: React.Ref<HTMLInputElement>): {
4 disabled: boolean;
5 error: boolean;
6 focused: boolean;
7 formControlContext: import("../FormControlUnstyled/FormControlContext").FormControlUnstyledState | undefined;
8 getInputProps: (externalProps?: Record<string, unknown> | undefined) => {
9 'aria-invalid': true | undefined;
10 defaultValue: string | number | readonly string[] | undefined;
11 ref: React.Ref<any>;
12 value: string | number | readonly string[] | undefined;
13 required: boolean;
14 disabled: boolean;
15 };
16 getRootProps: (externalProps?: Record<string, unknown> | undefined) => {
17 onClick: (event: React.MouseEvent<HTMLInputElement>) => void;
18 };
19 required: boolean;
20 value: unknown;
21};