formState.isSubmitting stays true when the fetcher's submitting and idle states land in one render
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 82/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- react, typescript
- Domain
- frontend
Research direction
Start in the useRemixForm implementation and find the effect that clears isSubmittingNetwork when isSubmittingForm is false. Reproduce the issue with a fast action and fetcher form using createRoutesStub; the issue provides the proposed dependency change. Done means formState.isSubmitting resets after the response, including when it contains errors, and the submit button re-enables.
Written by the indexing model from the issue text.
Description
useRemixForm sets isSubmittingNetwork to true in onSubmit and only clears it in an effect that depends on [isSubmittingForm]. When the action responds quickly, React Router can apply the fetcher's submitting and idle states in a single render. isSubmittingForm then stays false the whole time, the effect never re-runs, and formState.isSubmitting stays true until the component remounts. The form's submit button stays disabled after the response, including when the response has errors.
Reproduction: a route whose action returns immediately (for example () => ({ errors: { root: { message: 'Save failed' } } })) and a fetcher form whose button uses disabled={formState.isSubmitting}. Rendered with createRoutesStub in a unit test, it reproduces every time: the error shows, but the button never re-enables. In the browser it happens when the response arrives before React renders the submitting state, which we saw with a busy main thread.
Fix we're using as a patch: also reset when new data arrives:
useEffect(() => {
if (!isSubmittingForm) {
setIsSubmittingNetwork(false);
}
}, [isSubmittingForm, data]);
Seen on 7.2.1. 7.3.0 and main have the same effect.
- Dominant language
- TypeScript
- Stars
- 454
- Forks
- 44
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from code-forge-io/remix-hook-form
-
`remix-hook-form/middleware` imports `unstable_createContext`, breaking on `react-router` >= 7.9.0Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
code-forge-io/remix-hook-form#189 ·
-
good first issue help wanted
Difficulty 5/5 Over a week Newbie friendliness 30/100
code-forge-io/remix-hook-form#123 · 1 reaction ·
All issues in code-forge-io/remix-hook-form
Similar issues
-
bug(core): JsonOutputKeyToolsParser ignores returnId: truePossibly taken A pull request linked to this issue is open or already merged. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
langchain-ai/langchainjs#12239 ·
Maintainers usually reply within 1 day
-
Board view: the Monitoring column is always empty because compact issue rows drop displayStatusOpen
Difficulty 1/5 Under an hour Newbie friendliness 88/100
paperclipai/paperclip#21837 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
code-yeongyu/senpi#6813 ·
Maintainers usually reply within 1 day
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 93/100
lingdojo/kana-dojo#34169 · 1 comment · 5 reactions ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100