T
TanStack6mo ago
deep-jade

IsSubmitting not working nextjs server action submit

Hey Everyone, I used the tanstack form nextjs example but the issubmitting is not working. <form.Subscribe selector={(formState) => [formState.canSubmit, formState.isSubmitting]} > {([canSubmit, isSubmitting]) => ( <button type="submit" disabled={!canSubmit}> {isSubmitting ? "..." : "Submit"} </button> )} </form.Subscribe> It just always shows Submit never ... I could also publish a repo as example if it helps but it is really just the nextjs example: https://tanstack.com/form/latest/docs/framework/react/examples/next-server-actions?path=examples%2Freact%2Fnext-server-actions%2Fsrc%2Fapp%2Fclient-component.tsx
React TanStack Form Next Server Actions Example | TanStack Form Docs
An example showing how to implement Next Server Actions in React using TanStack Form.
1 Reply
rival-black
rival-black6mo ago
Just add ‘isPending’ or something as the 3rd item in the useActionState array and use that instead

Did you find this page helpful?