Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

chore: update `react-hook-form` (#44893)

Gildas Garciabacd524b22c2
diff --git a/apps/design-system/package.json b/apps/design-system/package.json
index b9cf2f78252..bb801fa920b 100644
--- a/apps/design-system/package.json
+++ b/apps/design-system/package.json
@@ -34,7 +34,7 @@
"react-data-grid": "7.0.0-beta.47",
"react-day-picker": "^9.11.1",
"react-dom": "catalog:",
- "react-hook-form": "^7.45.0",
+ "react-hook-form": "^7.71.2",
"react-inlinesvg": "^4.0.4",
"react-wrap-balancer": "^1.1.0",
"recharts": "catalog:",
diff --git a/apps/docs/package.json b/apps/docs/package.json
index ce060d7e88e..aaaeb678049 100644
--- a/apps/docs/package.json
+++ b/apps/docs/package.json
@@ -104,7 +104,7 @@
"react-copy-to-clipboard": "^5.1.0",
"react-dom": "catalog:",
"react-error-boundary": "^4.0.12",
- "react-hook-form": "^7.45.0",
+ "react-hook-form": "^7.71.2",
"react-intersection-observer": "^9.5.3",
"react-markdown": "^8.0.3",
"react-use": "^17.5.0",
diff --git a/apps/studio/components/interfaces/Database/EnumeratedTypes/EnumeratedTypeValueRow.tsx b/apps/studio/components/interfaces/Database/EnumeratedTypes/EnumeratedTypeValueRow.tsx
index 200e8a8527b..2b2b6391e57 100644
--- a/apps/studio/components/interfaces/Database/EnumeratedTypes/EnumeratedTypeValueRow.tsx
+++ b/apps/studio/components/interfaces/Database/EnumeratedTypes/EnumeratedTypeValueRow.tsx
@@ -1,7 +1,7 @@
import { useSortable } from '@dnd-kit/sortable'
import { CSS } from '@dnd-kit/utilities'
import { GripVertical, Trash } from 'lucide-react'
-import { Control } from 'react-hook-form'
+import type { Control, FieldPath, FieldValues } from 'react-hook-form'
import {
Button,
FormControl_Shadcn_,
@@ -12,23 +12,26 @@ import {
Input_Shadcn_,
} from 'ui'
-interface EnumeratedTypeValueRowProps {
- control: Control<any>
+interface EnumeratedTypeValueRowProps<
+ TFieldValues extends FieldValues = FieldValues,
+ TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,
+> {
+ control: Control<TFieldValues>
index: number
id: string
- name: string
+ name: TName
isDisabled?: boolean
onRemoveValue: () => void
}
-const EnumeratedTypeValueRow = ({
+const EnumeratedTypeValueRow = <TFieldValues extends FieldValues>({
control,
index,
id,
name,
isDisabled = false,
onRemoveValue,
-}: EnumeratedTypeValueRowProps) => {
+}: EnumeratedTypeValueRowProps<TFieldValues>) => {
const { attributes, listeners, setNodeRef, setActivatorNodeRef, transform, transition } =
useSortable({
disabled: isDisabled,
diff --git a/apps/studio/components/interfaces/Integrations/Integration/IntegrationOverviewTabV2/InstallIntegrationSheet/InstallationSettings.tsx b/apps/studio/components/interfaces/Integrations/Integration/IntegrationOverviewTabV2/InstallIntegrationSheet/InstallationSettings.tsx
index b2c2f793b54..72d5572e989 100644
--- a/apps/studio/components/interfaces/Integrations/Integration/IntegrationOverviewTabV2/InstallIntegrationSheet/InstallationSettings.tsx
+++ b/apps/studio/components/interfaces/Integrations/Integration/IntegrationOverviewTabV2/InstallIntegrationSheet/InstallationSettings.tsx
@@ -1,17 +1,20 @@
import { ExternalLink } from 'lucide-react'
import Link from 'next/link'
-import { UseFormReturn } from 'react-hook-form'
+import type { FieldPath, FieldValues, UseFormReturn } from 'react-hook-form'
import { Button, Card, CardContent, FormControl_Shadcn_, FormField_Shadcn_, SheetSection } from 'ui'
import { Input } from 'ui-patterns/DataInputs/Input'
import { FormItemLayout } from 'ui-patterns/form/FormItemLayout/FormItemLayout'
import { type InstallIntegrationSheetProps } from './InstallIntegrationSheet'
-export const InstallationSettings = ({
+export const InstallationSettings = <
+ TFieldValues extends FieldValues = FieldValues,
+ TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,
+>({
integration,
form,
}: InstallIntegrationSheetProps & {
- form: UseFormReturn<Record<string, string>, unknown, undefined>
+ form: UseFormReturn<TFieldValues, any, TFieldValues>
}) => {
const { inputs = {} } = integration
@@ -32,7 +35,7 @@ export const InstallationSettings = ({
<div key={key} className="flex flex-col gap-y-2 p-4">
<FormField_Shadcn_
key={key}
- name={key}
+ name={key as TName}
control={form.control}
render={({ field }) => (
<FormItemLayout
diff --git a/apps/studio/components/interfaces/Integrations/Wrappers/InputField.tsx b/apps/studio/components/interfaces/Integrations/Wrappers/InputField.tsx
index 06c08cfec06..7d208fee36e 100644
--- a/apps/studio/components/interfaces/Integrations/Wrappers/InputField.tsx
+++ b/apps/studio/components/interfaces/Integrations/Wrappers/InputField.tsx
@@ -1,25 +1,32 @@
import { InputVariants } from '@ui/components/shadcn/ui/input'
import { HelpCircle } from 'lucide-react'
import Link from 'next/link'
-import type { Control } from 'react-hook-form'
+import type { Control, FieldPath, FieldValues } from 'react-hook-form'
import { cn, FormControl_Shadcn_, FormField_Shadcn_, Input_Shadcn_, Textarea } from 'ui'
import { Input } from 'ui-patterns/DataInputs/Input'
import { FormItemLayout } from 'ui-patterns/form/FormItemLayout/FormItemLayout'
import type { ServerOption } from './Wrappers.types'
-interface InputFieldProps {
+interface InputFieldProps<TFieldValues extends FieldValues = FieldValues> {
option: ServerOption
- control: Control<any>
+ control: Control<TFieldValues>
loading?: boolean
}
-const InputField = ({ control, option, loading = false }: InputFieldProps) => {
+const InputField = <
+ TFieldValues extends FieldValues = FieldValues,
+ TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,
+>({
+ control,
+ option,
+ loading = false,
+}: InputFieldProps<TFieldValues>) => {
return (
<FormField_Shadcn_
control={control}
- name={option.name}
- defaultValue={option.defaultValue ?? ''}
+ name={option.name as TName}
+ defaultValue={(option.defaultValue ?? '') as any}
render={({ field }) => (
<FormItemLayout
name={option.name}
diff --git a/apps/studio/package.json b/apps/studio/package.json
index 41df887a757..ee91bb4f560 100644
--- a/apps/studio/package.json
+++ b/apps/studio/package.json
@@ -119,7 +119,7 @@
"react-dom": "catalog:",
"react-error-boundary": "^4.0.13",
"react-grid-layout": "^1.4.2",
- "react-hook-form": "^7.45.0",
+ "react-hook-form": "^7.71.2",
"react-inlinesvg": "^4.0.4",
"react-intersection-observer": "^9.5.3",
"react-markdown": "^8.0.3",
diff --git a/apps/ui-library/package.json b/apps/ui-library/package.json
index 4d70db00dfe..685a1739772 100644
--- a/apps/ui-library/package.json
+++ b/apps/ui-library/package.json
@@ -72,7 +72,7 @@
"openapi-fetch": "0.12.4",
"react": "catalog:",
"react-dom": "catalog:",
- "react-hook-form": "^7.45.0",
+ "react-hook-form": "^7.71.2",
"react-markdown": "^10.1.0",
"react-wrap-balancer": "^1.1.0",
"recharts": "catalog:",
diff --git a/apps/www/package.json b/apps/www/package.json
index c8db55a4963..03c536560ad 100644
--- a/apps/www/package.json
+++ b/apps/www/package.json
@@ -111,7 +111,7 @@
"@types/uuid": "^9.0.8",
"api-types": "workspace:*",
"postcss": "^8.5.3",
- "react-hook-form": "^7.45.0",
+ "react-hook-form": "^7.71.2",
"tailwindcss": "^3.4.1",
"tsconfig": "workspace:*",
"unist-util-visit-parents": "5.1.3",
diff --git a/packages/ui-patterns/package.json b/packages/ui-patterns/package.json
index 3e34ebc340f..ae16d063bad 100644
--- a/packages/ui-patterns/package.json
+++ b/packages/ui-patterns/package.json
@@ -811,7 +811,7 @@
"react-countdown": "^2.3.5",
"react-dom": "catalog:",
"react-error-boundary": "^4.0.12",
- "react-hook-form": "^7.45.0",
+ "react-hook-form": "^7.71.2",
"react-intersection-observer": "^9.8.2",
"react-markdown": "^9.0.1",
"react-medium-image-zoom": "^5.2.4",
diff --git a/packages/ui/package.json b/packages/ui/package.json
index dc55c57bf31..d61942413fc 100644
--- a/packages/ui/package.json
+++ b/packages/ui/package.json
@@ -63,7 +63,7 @@
"react-copy-to-clipboard": "^5.1.0",
"react-day-picker": "^9.11.1",
"react-dom": "catalog:",
- "react-hook-form": "^7.45.0",
+ "react-hook-form": "^7.71.2",
"react-intersection-observer": "^9.8.2",
"react-resizable-panels": "^4.6.5",
"recharts": "catalog:",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 98885175507..368c428a5db 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -164,7 +164,7 @@ importers:
dependencies:
'@hookform/resolvers':
specifier: ^3.1.1
'@tanstack/react-table':
specifier: ^8.21.3
@@ -214,8 +214,8 @@ importers:
specifier: 'catalog:'
version: 18.3.1([email protected])
react-hook-form:
- specifier: ^7.45.0
- version: 7.47.0([email protected])
+ specifier: ^7.71.2
+ version: 7.72.1([email protected])
react-inlinesvg:
specifier: ^4.0.4
version: 4.0.4([email protected])
@@ -318,7 +318,7 @@ importers:
version: 2.2.0
'@hookform/resolvers':
specifier: ^3.1.1
'@mdx-js/loader':
specifier: ^3.0.0
@@ -497,8 +497,8 @@ importers:
specifier: ^4.0.12
version: 4.0.13([email protected])
react-hook-form:
- specifier: ^7.45.0
- version: 7.47.0([email protected])
+ specifier: ^7.71.2
+ version: 7.72.1([email protected])
react-intersection-observer:
specifier: ^9.5.3
@@ -906,7 +906,7 @@ importers:
version: 2.1.3([email protected])
'@hookform/resolvers':
specifier: ^3.1.1
'@mjackson/multipart-parser':
specifier: ^0.10.1
version: 0.10.1
@@ -1124,8 +1124,8 @@ importers:
specifier: ^1.4.2
react-hook-form:
- specifier: ^7.45.0
- version: 7.47.0([email protected])
+ specifier: ^7.71.2
+ version: 7.72.1([email protected])
react-inlinesvg:
specifier: ^4.0.4
version: 4.0.4([email protected])
@@ -1381,7 +1381,7 @@ importers:
dependencies:
'@hookform/resolvers':
specifier: ^3.1.1
'@monaco-editor/react':
specifier: ^4.6.0
@@ -1545,8 +1545,8 @@ importers:
specifier: 'catalog:'
version: 18.3.1([email protected])
react-hook-form:
- specifier: ^7.45.0
- version: 7.47.0([email protected])
+ specifier: ^7.71.2
+ version: 7.72.1([email protected])
react-markdown:
specifier: ^10.1.0
@@ -1908,7 +1908,7 @@ importers:
version: 7.29.0([email protected])
'@hookform/resolvers':
specifier: ^3.1.1
'@types/animejs':
specifier: ^3.1.12
version: 3.1.12
@@ -1952,8 +1952,8 @@ importers:
specifier: ^8.5.3
version: 8.5.8
react-hook-form:
- specifier: ^7.45.0
- version: 7.47.0([email protected])
+ specifier: ^7.71.2
+ version: 7.72.1([email protected])
tailwindcss:
specifier: ^3.4.1
@@ -2585,8 +2585,8 @@ importers:
specifier: 'catalog:'
version: 18.3.1([email protected])
react-hook-form:
- specifier: ^7.45.0
- version: 7.47.0([email protected])
+ specifier: ^7.71.2
+ version: 7.72.1([email protected])
react-intersection-observer:
specifier: ^9.8.2
@@ -2662,7 +2662,7 @@ importers:
dependencies:
'@hookform/resolvers':
specifier: ^3.1.1
'@monaco-editor/react':
specifier: ^4.6.0
@@ -2757,8 +2757,8 @@ importers:
specifier: ^4.0.12
version: 4.0.13([email protected])
react-hook-form:
- specifier: ^7.45.0
- version: 7.47.0([email protected])
+ specifier: ^7.71.2
+ version: 7.72.1([email protected])
react-intersection-observer:
specifier: ^9.8.2
@@ -16337,11 +16337,11 @@ packages:
react: '>= 16.3.0'
react-dom: '>= 16.3.0'
- resolution: {integrity: sha512-F/TroLjTICipmHeFlMrLtNLceO2xr1jU3CyiNla5zdwsGUGu2UOxxR4UyJgLlhMwLW/Wzp4cpJ7CPfgJIeKdSg==}
- engines: {node: '>=12.22.0'}
+ resolution: {integrity: sha512-RhwBoy2ygeVZje+C+bwJ8g0NjTdBmDlJvAUHTxRjTmSUKPYsKfMphkS2sgEMotsY03bP358yEYlnUeZy//D9Ig==}
+ engines: {node: '>=18.0.0'}
peerDependencies:
- react: ^16.8.0 || ^17 || ^18
+ react: ^16.8.0 || ^17 || ^18 || ^19
resolution: {integrity: sha512-OnXi+IHoY2zj6rt+kLmXQth9HZ3rS1TDtDwjFbELcCZngAJC32nXp2ZzLp4FpijzISDe7YfHI3SFs9qALWv+xw==}
@@ -21465,9 +21465,9 @@ snapshots:
dependencies:
hono: 4.12.12
dependencies:
- react-hook-form: 7.47.0([email protected])
+ react-hook-form: 7.72.1([email protected])
'@humanfs/[email protected]': {}
@@ -35595,7 +35595,7 @@ snapshots:
resize-observer-polyfill: 1.5.1
dependencies:
react: 18.3.1