Skip to content

Commit ed33c7b

Browse files
docs(react-form): add type=submit in form-composition.md subscribe button (#1521)
1 parent 8b2b65c commit ed33c7b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

docs/framework/react/guides/form-composition.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,11 @@ function SubscribeButton({ label }: { label: string }) {
124124
const form = useFormContext()
125125
return (
126126
<form.Subscribe selector={(state) => state.isSubmitting}>
127-
{(isSubmitting) => <button disabled={isSubmitting}>{label}</button>}
127+
{(isSubmitting) => (
128+
<button type="submit" disabled={isSubmitting}>
129+
{label}
130+
</button>
131+
)}
128132
</form.Subscribe>
129133
)
130134
}

0 commit comments

Comments
 (0)