Skip to content
This repository has been archived by the owner on Aug 23, 2022. It is now read-only.

Typescript ControlProps UpdateOn/ValidateOn Fixes #563

Merged
merged 1 commit into from
Dec 9, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 5 additions & 2 deletions react-redux-form.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ type MapPropsObject = { [key: string]: (props: MapPropsProps) => any };

type MapProps = MapPropsFunc | MapPropsObject;

type UpdateOn = 'change' | 'blur' | 'focus';
type ValidateOn = 'change' | 'blur' | 'focus';

export interface ControlProps<T> extends React.HTMLProps<T> {
/**
* Wrap field into custom component
Expand All @@ -127,7 +130,7 @@ export interface ControlProps<T> extends React.HTMLProps<T> {
* <input type="text" />
* </Field>
*/
updateOn?: 'change' | 'blur' | 'focus';
updateOn?: UpdateOn | UpdateOn[];
/**
* A map where the keys are validation keys, and the values are the corresponding functions that determine the validity of each key, given the model's value.
* Validator functions accept the value and return true if the field is valid.
Expand All @@ -142,7 +145,7 @@ export interface ControlProps<T> extends React.HTMLProps<T> {
*
* @default change
*/
validateOn?: 'change' | 'blur' | 'focus';
validateOn?: ValidateOn | ValidateOn[];
asyncValidators?: AsyncValidators;
/**
* Indicates when to validate the field asynchronously
Expand Down