`withFieldGroup` array handling with nested

オープン
#1,648 コメント 4 件 リアクション 2 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
38/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
静か
技術スタック
react, typescript
領域
frontend

調査の方向性

リンクされたCodeSandboxの再現から始め、ネストされた配列の値を上下に移動する際のwithFieldGroupとSingleFieldWithReorderコンポーネントに焦点を当てます。レンダリングされたネストされた値が親配列のマッピングと食い違う理由を追跡し、fieldsとformをrender関数に公開すべきかどうかを調査します。ネストされたグループの同期が維持され、render propsの動作が解決または文書化されれば完了です。

索引モデルが issue の本文から書いたものです。

説明

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

主要言語
TypeScript
スター
6.8k
フォーク
711
平均マージ
1日 6時間
マージ済み PR(30日)
12

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

TanStack/form のほかの issue

TanStack/form の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。