mirror of
https://github.com/supabase/supabase.git
synced 2026-10-05 09:25:06 +03:00
chore: react-hook-form best practices (#44221)
## Problem The design system documentation and examples promote an invalid usage of react-hook-form state. ## Solution - Fix the documentation and examples - Update Claude skills for future components ## Out of scope - Fix current code across the repository
This commit is contained in:
1 parent
fba5a8a001
commit
5c98bb6c0f
3 files changed
+9
-5
No files matched your search
@@ -1,5 +1,5 @@
|
||||
---
|
||||
description: "Studio: form patterns (page layouts + side panels) and react-hook-form conventions"
|
||||
description: 'Studio: form patterns (page layouts + side panels) and react-hook-form conventions'
|
||||
globs:
|
||||
- apps/studio/**/*.{ts,tsx}
|
||||
alwaysApply: false
|
||||
@@ -29,7 +29,6 @@ Use the Design System UI pattern docs as the source of truth:
|
||||
|
||||
## Actions and state
|
||||
|
||||
- Handle dirty state (`form.formState.isDirty`) to show Cancel and to disable Save.
|
||||
- Handle dirty state by destructuring `isDirty` from `formState` (`const { isDirty } = form.formState`) then use it to show Cancel and to disable Save.
|
||||
- Show loading on submit buttons via `loading`.
|
||||
- When submit button is outside the `<form>`, set a stable `formId` and use the button’s `form` prop.
|
||||
|
||||
Reference in new issue
Block a user