UNPKG

envoc-form

Version:

Envoc form components

14 lines (13 loc) 905 B
import { ElementType } from 'react'; import { RenderComponent, RenderComponentProps } from './Field'; import { InjectedFieldProps } from './InjectedFieldProps'; export declare type StandAloneInputProps<TValue, TRenderComponent extends ElementType> = { /** Component to render inside of the field. */ Component: RenderComponent<TValue, TRenderComponent>; /** Value of the field. */ value: TValue; /** Function to change the value of the field. */ onChange: (arg: TValue) => void; } & Omit<RenderComponentProps<TValue, TRenderComponent>, keyof InjectedFieldProps<TValue> | 'value' | 'onChange' | 'normalize' | 'validate'>; /** The stand alone version of `<Field/>`. Can use a type of input component outside of a `<Form/>`. */ export default function StandAloneInput<TValue, TComponent extends ElementType>(props: StandAloneInputProps<TValue, TComponent>): JSX.Element;