Skip to content
Source
Sign inSign up
TanStack/form
Open History to see the last commit

SubmitButton.tsx

14 lines366 Bytes

1import { useFormContext } from '../AppForm'
2​
3export function SubmitButton({ label }: { label: string }) {
4 const form = useFormContext()
5 return (
6 <form.Subscribe selector={(state) => state.isSubmitting}>
7 {(isSubmitting) => (
8 <button type="submit" disabled={isSubmitting}>
9 {label}
10 </button>
11 )}
12 </form.Subscribe>
13 )