From 80c16a7ee891096eddcbd2df2c6d40078f7e8f5a Mon Sep 17 00:00:00 2001 From: Ray Zane Date: Thu, 1 Oct 2020 17:07:45 -0400 Subject: [PATCH] Update documentation --- README.md | 29 +++++++++++++++++++++++++++++ documentation.yml | 1 + 2 files changed, 30 insertions(+) diff --git a/README.md b/README.md index 93200fe..fa45533 100644 --- a/README.md +++ b/README.md @@ -85,6 +85,7 @@ const Input = ({ - [FormField](#formfield) - [ValidateFn](#validatefn) - [Submit](#submit) +- [Submission](#submission) - [Reset](#reset) - [UseFormOptions](#useformoptions) - [UseValidationOptions](#usevalidationoptions) @@ -372,6 +373,12 @@ Indicate that the form is validating Type: SetState<[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)> +#### setSubmission + +Update the form's submission status + +Type: SetState<[Submission](#submission)> + #### reset Reset the state of the form @@ -430,6 +437,12 @@ Indicates that the form is currently being submitted Type: [boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean) +#### submission + +Keeps track of the form's submission status + +Type: [Submission](#submission) + #### setValue Change the value. Just like with `setState`, you can pass a callback @@ -467,6 +480,22 @@ Submits the form. Type: function (event: FormEvent<[HTMLFormElement](https://developer.mozilla.org/docs/Web/API/HTMLFormElement)>): [Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<void> +### Submission + +Keeps track of submissions. + +#### count + +The number of times the form has been submitted + +Type: [number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number) + +#### error + +If the submission flow throws an error, it will appear here. + +Type: [Error](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error) + ### Reset Resets the form. diff --git a/documentation.yml b/documentation.yml index c928f05..39eb4a7 100644 --- a/documentation.yml +++ b/documentation.yml @@ -14,6 +14,7 @@ toc: - FormField - ValidateFn - Submit + - Submission - Reset - UseFormOptions - UseValidationOptions