UNPKG

@react-md/form

Version:

This package is for creating all the different form input types.

13 lines (12 loc) 582 B
declare type DefaultValue<T extends string> = T | (() => T); declare type ReturnValue<T extends string> = [T, (nextValue: string) => void]; /** * This is a simple hook that will allow you to "strongly" type a `Select` * component's value since the `onChange` handler only returns a `string`. * * @param defaultValue - The default value to use * @returns an ordered list containing the current value followed by the * dispatch function to update the state. */ export declare function useSelectState<T extends string>(defaultValue: DefaultValue<T>): ReturnValue<T>; export {};