Skip to content

Commit ca4c595

Browse files
committed
Added docs for beforeSubmit and afterSubmit
1 parent b9985e6 commit ca4c595

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,10 @@ These are props that you pass to
505505
[`<Field/>`](#field--reactcomponenttypefieldprops). You must provide one of the
506506
ways to render: `component`, `render`, or `children`.
507507

508+
#### `afterSubmit?: () => void`
509+
510+
A callback to notify fields after submission has completed successfully.
511+
508512
#### `allowNull?: boolean`
509513

510514
By default, if your value is `null`, `<Field/>` will convert it to `''`, to
@@ -513,6 +517,10 @@ ensure
513517
But if you pass `true` to `allowNull`, `<Field/>` will give you a `null` value.
514518
Defaults to `false`.
515519

520+
#### `beforeSubmit?: () => void | false`
521+
522+
A function to call just before calling `onSubmit`. If `beforeSubmit` returns `false`, the submission will be aborted. If one of your fields returns `false` on `beforeSubmit`, other fields may not have their `beforeSubmit` called, as the submission is aborted on the first one that returns `false`.
523+
516524
#### `children?: ((props: FieldRenderProps) => React.Node) | React.Node`
517525

518526
A render function that is given [`FieldRenderProps`](#fieldrenderprops), as well

0 commit comments

Comments
 (0)