From eb01d24998948acb75479ab7e366379b0f153aa2 Mon Sep 17 00:00:00 2001 From: Jason Killian Date: Thu, 6 Feb 2020 12:54:04 -0500 Subject: [PATCH] [redux-form] Add additional params to ValidateCallback type (#42075) --- types/redux-form/lib/reduxForm.d.ts | 2 ++ types/redux-form/redux-form-tests.tsx | 11 ++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/types/redux-form/lib/reduxForm.d.ts b/types/redux-form/lib/reduxForm.d.ts index cecef650ef..cf14beae37 100644 --- a/types/redux-form/lib/reduxForm.d.ts +++ b/types/redux-form/lib/reduxForm.d.ts @@ -37,6 +37,8 @@ export interface ValidateCallback { nextProps: P & InjectedFormProps; props: P & InjectedFormProps; initialRender: boolean; + lastFieldValidatorKeys: string[]; + fieldValidatorKeys: string[]; structure: any; } diff --git a/types/redux-form/redux-form-tests.tsx b/types/redux-form/redux-form-tests.tsx index 5cd4ed3ce2..d859c75616 100644 --- a/types/redux-form/redux-form-tests.tsx +++ b/types/redux-form/redux-form-tests.tsx @@ -242,7 +242,16 @@ const testFormWithChangeFunctionDecorator = reduxForm; const Test = reduxForm({ - form : "test" + form : "test", + shouldError: ({ + values, + nextProps, + props, + initialRender, + lastFieldValidatorKeys, + fieldValidatorKeys, + structure + }) => true, })( class Test extends React.Component { handleSubmitForm = (values: Partial, dispatch: Dispatch, props: {}) => {};