diff --git a/docs/Collection.mdx b/docs/Collection.mdx index 67058ab0..33fc9766 100644 --- a/docs/Collection.mdx +++ b/docs/Collection.mdx @@ -39,9 +39,9 @@ A Collection can be of type: **object** or **array**. - Default value is *false*. - * **true**: sync validation messages will be showing only when the event onBlur of any collection's field is triggered by the user action at any level of nesting. -The async validation messages will be showing only at form submission. - * **false**: validation messages (sync and async) will be showing only at form submission. + * **true**: sync validation messages will be shown only when the event onBlur of any collection's field is triggered by the user action at any level of nesting. +The async validation messages will be shown only at form submission. + * **false**: validation messages (sync and async) will be shown only at form submission. ```javascript const [status, validation] = useValidation([anyValidationFunc]) @@ -156,7 +156,7 @@ const CustomInput = withIndex(({ type, name, value, index, ...restAttr }) => {
-Array Collection of Input fields with indexes handled maunally. +Array Collection of Input fields with indexes handled manually. ```javascript import { Form, Input, Collection } from 'usetheform' diff --git a/docs/Form.mdx b/docs/Form.mdx index b8cf9a09..bed5daf2 100644 --- a/docs/Form.mdx +++ b/docs/Form.mdx @@ -214,8 +214,8 @@ Validation at Form level: {() => { - const graterThan10 = ({ values }) => ((values && (values["A"] + values["B"] > 10)) ? undefined : "A+B must be > 10"); - const [status, validationProps] = useValidation([graterThan10]); + const greaterThan10 = ({ values }) => ((values && (values["A"] + values["B"] > 10)) ? undefined : "A+B must be > 10"); + const [status, validationProps] = useValidation([greaterThan10]); return (
@@ -279,7 +279,7 @@ export const asyncTestForm = ({ values }) => // it could be an API call or any async operation setTimeout(() => { if (!values || !values.a || !values.b) { - reject("Emtpy values are not allowed "); + reject("Empty values are not allowed "); } if (values.a + values.b >= 5) { reject("The sum must be less than '5'"); diff --git a/docs/FormContext.mdx b/docs/FormContext.mdx index 59e4b6d7..1ec053b0 100644 --- a/docs/FormContext.mdx +++ b/docs/FormContext.mdx @@ -61,7 +61,7 @@ const onSubmit = (formState) => new Promise((resolve, reject) => { // some async ``` - It will be only invoked if your form passes all validations added at any level (Collections or Fields). -- For each invocation, the value **submitAttempts** will be incremented. +- Each time the function is invoked, the value **submitAttempts** will be incremented. **`initialState`**: object @@ -240,7 +240,7 @@ export const asyncTestForm = ({ values }) => // it could be an API call or any async operation setTimeout(() => { if (!values || !values.a || !values.b) { - reject("Emtpy values are not allowed "); + reject("Empty values are not allowed "); } if (values.a + values.b >= 5) { reject("The sum must be less than '5'");