UNPKG

@airplane/views

Version:

A React library for building Airplane views. Views components are optimized in style and functionality to produce internal apps that are easy to build and maintain.

15 lines (14 loc) 594 B
import { Dispatch } from "react"; import { InputAction, InputState } from "./reducer"; import { InputProps } from "./types"; /** * useInput is a hook that generates props for an input component. */ export declare const useInput: <TValue, TState extends InputState<TValue>, TOnChange>(props: InputProps<TValue, TOnChange>, state: TState, dispatch: Dispatch<InputAction<TValue>>, getChangeValue: (v: TOnChange) => TValue) => { inputProps: { error: string | undefined; onChange: (v: TOnChange) => void; value: TValue | undefined; disabled: boolean; }; };