From 484192c10219281df1cfbf1d3344ad57302e7ff7 Mon Sep 17 00:00:00 2001 From: Sudarshan H V <45071414+SudarshanHV@users.noreply.github.com> Date: Mon, 1 May 2023 19:11:48 +0530 Subject: [PATCH 1/3] Fixed typos and grammar in Collection.mdx --- docs/Collection.mdx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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' From 89e55a5c97215734a948c6a7b0b7d6f273595c2e Mon Sep 17 00:00:00 2001 From: Sudarshan H V <45071414+SudarshanHV@users.noreply.github.com> Date: Tue, 2 May 2023 23:44:55 +0530 Subject: [PATCH 2/3] Edited typos and few grammatical errors in FormContext.mdx --- docs/FormContext.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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'"); From 5f1abdeb883c1aa83bc8440f0f9a93f5144928c1 Mon Sep 17 00:00:00 2001 From: Sudarshan H V <45071414+SudarshanHV@users.noreply.github.com> Date: Tue, 2 May 2023 23:50:10 +0530 Subject: [PATCH 3/3] Removed typos in Form.mdx --- docs/Form.mdx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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'");