Skip to content

Commit deb9271

Browse files
committed
fix: update WebsiteDialog form state handling.
1 parent f3277a7 commit deb9271

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

apps/dashboard/components/website-dialog.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,10 @@ export function WebsiteDialog({
154154
const isPending =
155155
createWebsiteMutation.isPending || updateWebsiteMutation.isPending;
156156

157-
const isSubmitDisabled = !(form.formState.isValid && form.formState.isDirty);
157+
// Should not access directly (form.formState.isValid); that doesn't trigger re-render
158+
// https://react-hook-form.com/docs/useform/formstate
159+
const { isValid, isDirty } = form.formState;
160+
const isSubmitDisabled = !(isValid && isDirty);
158161

159162
return (
160163
<FormDialog

0 commit comments

Comments
 (0)