formState.isSubmitting stays true when the fetcher's submitting and idle states land in one render
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 82/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- react, typescript
- Área
- frontend
Línea de trabajo
Empieza por la implementación de useRemixForm y localiza el efecto que restablece isSubmittingNetwork cuando isSubmittingForm es false. Reproduce el problema con una action rápida y un formulario fetcher usando createRoutesStub; el issue incluye el cambio de dependencias propuesto. El trabajo está terminado cuando formState.isSubmitting se restablece después de la respuesta, incluso si contiene errores, y el botón de envío vuelve a habilitarse.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- TypeScript
- Estrellas
- 454
- Forks
- 44
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Sin guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de code-forge-io/remix-hook-form
-
`remix-hook-form/middleware` imports `unstable_createContext`, breaking on `react-router` >= 7.9.0Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
code-forge-io/remix-hook-form#189 ·
-
Support for custom serialisersAbiertogood first issue help wanted
Dificultad 5/5 Más de una semana Aptitud para principiantes 30/100
code-forge-io/remix-hook-form#123 · 1 reacción ·
Todos los issues de code-forge-io/remix-hook-form
Issues similares
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
langchain-ai/langchainjs#12239 ·
Los mantenedores suelen responder en 1 día
-
Board view: the Monitoring column is always empty because compact issue rows drop displayStatusAbierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
paperclipai/paperclip#21837 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 73/100
code-yeongyu/senpi#6813 ·
Los mantenedores suelen responder en 1 día
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Dificultad 1/5 Menos de una hora Aptitud para principiantes 93/100
lingdojo/kana-dojo#34169 · 1 comentario · 5 reacciones ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100