From 2e63558b0ef2cdfda5ec2ae61a97d49510414947 Mon Sep 17 00:00:00 2001 From: Adishwar Rishi Date: Sun, 3 Mar 2024 17:12:52 +1100 Subject: [PATCH] fix(form-state): Add validatingFields to formState return from useRemixForm to be compatible with react-hook-form 7.51.0 --- package-lock.json | 25 ++++++++++++------------- package.json | 2 +- src/hook/index.test.tsx | 1 + src/hook/index.tsx | 2 ++ 4 files changed, 16 insertions(+), 14 deletions(-) diff --git a/package-lock.json b/package-lock.json index 87d77e9..cc5b1fa 100644 --- a/package-lock.json +++ b/package-lock.json @@ -28,7 +28,7 @@ "prettier": "^3.0.1", "react": "^18.2.0", "react-dom": "^18.2.0", - "react-hook-form": "^7.49.3", + "react-hook-form": "^7.51.0", "remix-development-tools": "^3.1.1", "rollup": "^3.20.2", "rollup-plugin-typescript2": "^0.34.1", @@ -11321,12 +11321,11 @@ } }, "node_modules/react-hook-form": { - "version": "7.49.3", - "resolved": "https://registry.npmjs.org/react-hook-form/-/react-hook-form-7.49.3.tgz", - "integrity": "sha512-foD6r3juidAT1cOZzpmD/gOKt7fRsDhXXZ0y28+Al1CHgX+AY1qIN9VSIIItXRq1dN68QrRwl1ORFlwjBaAqeQ==", + "version": "7.51.0", + "resolved": "https://registry.npmjs.org/react-hook-form/-/react-hook-form-7.51.0.tgz", + "integrity": "sha512-BggOy5j58RdhdMzzRUHGOYhSz1oeylFAv6jUSG86OvCIvlAvS7KvnRY7yoAf2pfEiPN7BesnR0xx73nEk3qIiw==", "engines": { - "node": ">=18", - "pnpm": "8" + "node": ">=12.22.0" }, "funding": { "type": "opencollective", @@ -23028,9 +23027,9 @@ } }, "react-hook-form": { - "version": "7.49.3", - "resolved": "https://registry.npmjs.org/react-hook-form/-/react-hook-form-7.49.3.tgz", - "integrity": "sha512-foD6r3juidAT1cOZzpmD/gOKt7fRsDhXXZ0y28+Al1CHgX+AY1qIN9VSIIItXRq1dN68QrRwl1ORFlwjBaAqeQ==", + "version": "7.51.0", + "resolved": "https://registry.npmjs.org/react-hook-form/-/react-hook-form-7.51.0.tgz", + "integrity": "sha512-BggOy5j58RdhdMzzRUHGOYhSz1oeylFAv6jUSG86OvCIvlAvS7KvnRY7yoAf2pfEiPN7BesnR0xx73nEk3qIiw==", "requires": {} }, "react-is": { @@ -23303,7 +23302,7 @@ "prettier": "^3.0.1", "react": "^18.2.0", "react-dom": "^18.2.0", - "react-hook-form": "^7.49.3", + "react-hook-form": "^7.51.0", "remix-development-tools": "^3.1.1", "remix-hook-form": "file:", "rollup": "^3.20.2", @@ -31011,9 +31010,9 @@ } }, "react-hook-form": { - "version": "7.49.3", - "resolved": "https://registry.npmjs.org/react-hook-form/-/react-hook-form-7.49.3.tgz", - "integrity": "sha512-foD6r3juidAT1cOZzpmD/gOKt7fRsDhXXZ0y28+Al1CHgX+AY1qIN9VSIIItXRq1dN68QrRwl1ORFlwjBaAqeQ==", + "version": "7.51.0", + "resolved": "https://registry.npmjs.org/react-hook-form/-/react-hook-form-7.51.0.tgz", + "integrity": "sha512-BggOy5j58RdhdMzzRUHGOYhSz1oeylFAv6jUSG86OvCIvlAvS7KvnRY7yoAf2pfEiPN7BesnR0xx73nEk3qIiw==", "requires": {} }, "react-is": { diff --git a/package.json b/package.json index 0abbfdb..4d5f748 100644 --- a/package.json +++ b/package.json @@ -87,7 +87,7 @@ "prettier": "^3.0.1", "react": "^18.2.0", "react-dom": "^18.2.0", - "react-hook-form": "^7.49.3", + "react-hook-form": "^7.51.0", "remix-development-tools": "^3.1.1", "rollup": "^3.20.2", "rollup-plugin-typescript2": "^0.34.1", diff --git a/src/hook/index.test.tsx b/src/hook/index.test.tsx index 3b2f735..ac222a7 100644 --- a/src/hook/index.test.tsx +++ b/src/hook/index.test.tsx @@ -39,6 +39,7 @@ describe("useRemixForm", () => { isSubmitting: false, isValid: false, isValidating: false, + validatingFields: {}, touchedFields: {}, submitCount: 0, isLoading: false, diff --git a/src/hook/index.tsx b/src/hook/index.tsx index 8ce19e7..c303c97 100644 --- a/src/hook/index.tsx +++ b/src/hook/index.tsx @@ -85,6 +85,7 @@ export const useRemixForm = ({ isSubmitting, isValid, isValidating, + validatingFields, touchedFields, submitCount, errors, @@ -125,6 +126,7 @@ export const useRemixForm = ({ isSubmitting: isSubmittingForm || isSubmitting, isValid, isValidating, + validatingFields, touchedFields, submitCount, isLoading,