formState.isSubmitting stays true when the fetcher's submitting and idle states land in one render
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 82/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- react, typescript
- Lĩnh vực
- frontend
Hướng nghiên cứu
Bắt đầu từ phần triển khai useRemixForm và tìm effect xóa isSubmittingNetwork khi isSubmittingForm là false. Tái hiện sự cố bằng một action nhanh và form fetcher sử dụng createRoutesStub; issue đưa ra thay đổi dependency được đề xuất. Hoàn thành khi formState.isSubmitting được đặt lại sau response, kể cả khi response có lỗi, và nút gửi được bật lại.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- TypeScript
- Star
- 454
- Fork
- 44
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Không có hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của code-forge-io/remix-hook-form
-
`remix-hook-form/middleware` imports `unstable_createContext`, breaking on `react-router` >= 7.9.0Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
code-forge-io/remix-hook-form#189 ·
-
Support for custom serialisersĐang mởgood first issue help wanted
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 30/100
code-forge-io/remix-hook-form#123 · 1 reaction ·
Tất cả issue của code-forge-io/remix-hook-form
Issue tương tự
-
area:cli area:security bug priority:medium
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
rtk-ai/rtk#5127 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
"code source" and "numerique.gouv" links: "new window" mention duplicated in the accessible nameĐang mởaccessibility
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
numerique-gouv/lasuite-landingpage#315 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
needs:triage
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
HyeokjaeChoi/vaultme#585 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement priority/P2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
beettlle/pi-smart-router#200 ·