Devtools shows duplicate form entries in React Strict Mode after 0.2.11 upgrade

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

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

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

評価

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

調査の方向性

reactStrictMode を有効にした Next.js アプリで @tanstack/[email protected] を使用して問題を再現し、0.2.9 と比較します。#1978 と @tanstack/devtools-utils のアップグレードに関連して導入された登録および cleanup の動作を調査します。Strict Mode で重複ではなく 1 つのフォームエントリが表示されれば完了です。

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

説明

v1 v2: needs investigation

Describe the bug

After upgrading @tanstack/react-form-devtools from 0.2.9 to 0.2.11, the devtools panel shows duplicate form entries (two identical "TANSTACK TanStack Form" headers) when React Strict Mode is enabled.

Your minimal, reproducible example

Any Next.js app with reactStrictMode: true in next.config.js and a form using TanStack Form.

Steps to reproduce

  1. Create a Next.js app with reactStrictMode: true
  2. Install @tanstack/[email protected] - observe single form entry in devtools
  3. Upgrade to @tanstack/[email protected] - observe duplicate form entries

Expected behavior

Single form entry in devtools, same as in 0.2.9.

How often does this bug happen?

Every time (100% reproducible)

Screenshots

Image

Two identical "TANSTACK TanStack Form" headers appear in the devtools panel.

Platform

  • Next.js 15.x with React 19
  • reactStrictMode: true
  • macOS / Chrome

TanStack Form version

Analysis

The issue appears to be related to the strict mode fix in #1978. React Strict Mode intentionally mounts components twice (mount → unmount → mount). The fix in 0.2.11 prevents the error but seems to cause forms to be registered twice instead of being properly cleaned up on the first unmount.

The significant version jump in @tanstack/devtools-utils (0.0.9 → 0.2.3) is likely where the regression was introduced.

主要言語
TypeScript
スター
6.8k
フォーク
717
平均マージ
5日 22時間
マージ済み PR(30日)
14

環境構築

はじめの一歩

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

TanStack/form のほかの issue

TanStack/form の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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