Open History to see the last commit
1import type { AnySolidFormApi } from '@tanstack/solid-form'
2β
3export function FormSubmitButton(props: { form: AnySolidFormApi }) {
4 return (
5 <props.form.Subscribe
6 selector={(state) => [state.canSubmit, state.isSubmitting] as const}
7 >
8 {(state) => (
9 <button type="submit" disabled={!state()[0] || state()[1]}>
10 {state()[1] ? '...' : 'Submit'}
11 </button>
12 )}
13 </props.form.Subscribe>
14 )
15}