`withFieldGroup` array handling with nested

Abierto
#1,648 4 comentarios 2 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
38/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Tranquilo
Stack tecnológico
react, typescript
Área
frontend

Línea de trabajo

Comienza con la reproducción vinculada de CodeSandbox, centrándote en withFieldGroup y el componente SingleFieldWithReorder mientras mueves los valores de arrays anidados hacia arriba y hacia abajo. Rastrea por qué los valores anidados renderizados divergen del mapeo del array padre e inspecciona si fields y form deberían estar disponibles para la función de renderizado. Se considera terminado cuando el grupo anidado permanece sincronizado y el comportamiento de las render props queda resuelto o documentado.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

v1 v2: needs investigation
Describe the bug

When combining the withFieldGroup for a complex array handling, the nested array element seems out of sync with the actual value of the group.

I've just tested while passing the root form to the SingleFieldWithReorder and the nested elements keep being out of sync (regarding the json value displayed)


Also, this is unrelated but when looking at the extra props of the render function, it seems to pass the fields and the form. Idk if this is expected or if the props must be sanitized when rendering to remove theses values before passing the props to the render method. (They are undocumented and not typed)

Your minimal, reproducible example

https://codesandbox.io/p/devbox/misty-monad-8t29lx?workspaceId=ws_PkVpfRWHUp5vMscgD59gVj

Steps to reproduce
  1. Try to move the value with the move down|move up buttons.
  2. See that the values from the base array mapping are correct, but the values rendered in the element aren't.
Expected behavior

I think the nested group value should remain sync with the array mapping from the parent group

How often does this bug happen?

Every time

Screenshots or Videos

No response

Platform
  • Browser: Tested on chrome 138.0.7204.183 (Official Build) (64-bit)
TanStack Form adapter

react-form

TanStack Form version

v1.15.1

TypeScript version

No response

Additional context

No response

Lenguaje dominante
TypeScript
Estrellas
6.8k
Forks
711
Merge medio
1 d 6 h
PR fusionados (30 d)
12

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de TanStack/form

Todos los issues de TanStack/form

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.