Skip to content

Commit

Permalink
Added docs for beforeSubmit and afterSubmit
Browse files Browse the repository at this point in the history
  • Loading branch information
erikras committed May 16, 2019
1 parent b9985e6 commit ca4c595
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,10 @@ These are props that you pass to
[`<Field/>`](#field--reactcomponenttypefieldprops). You must provide one of the
ways to render: `component`, `render`, or `children`.

#### `afterSubmit?: () => void`

A callback to notify fields after submission has completed successfully.

#### `allowNull?: boolean`

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

#### `beforeSubmit?: () => void | false`

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`.

#### `children?: ((props: FieldRenderProps) => React.Node) | React.Node`

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

0 comments on commit ca4c595

Please sign in to comment.