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

Commit 842a662

Browse files
authored
Merge pull request #854 from caesay/patch-3
Add prop onBeforeSubmit prop to form
2 parents b98fd89 + 851d316 commit 842a662

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

react-redux-form.d.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,11 @@ interface BaseFormProps {
313313
* * If you want better performance, you can use validateOn="submit", depending on your use-case.
314314
*/
315315
validateOn?: 'change' | 'submit';
316+
/**
317+
* This handler function is called regardless of the validity of the form, and allows you to prevent the default action
318+
* if using a form action url.
319+
*/
320+
onBeforeSubmit?: (event?: Event) => void;
316321
/**
317322
* The handler function called when the form is submitted. This works almost exactly like a normal <form onSubmit={...}> handler, with a few differences:
318323
* * The submit event's default action is prevented by default, using event.preventDefault().

0 commit comments

Comments
 (0)