Devtools shows duplicate form entries in React Strict Mode after 0.2.11 upgrade
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 新手友好度
- 38/100
- Issue 類型
- 缺陷
- 描述清晰度
- 基本清楚
- 活躍度
- 停滯
- 技術堆疊
- nextjs, react, typescript
研究方向
在啟用 reactStrictMode 的 Next.js 應用程式中使用 @tanstack/[email protected] 重現該問題,並與 0.2.9 進行比較。檢查圍繞 #1978 以及 @tanstack/devtools-utils 升級引入的註冊和 cleanup 行為;當 Strict Mode 顯示一個表單項目而不是重複項目時,即表示完成。
由索引模型根據 Issue 內容生成。
描述
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
- Create a Next.js app with
reactStrictMode: true - Install
@tanstack/[email protected]- observe single form entry in devtools - 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
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
- Working:
@tanstack/[email protected]with@tanstack/[email protected] - Broken:
@tanstack/[email protected]with@tanstack/[email protected]
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 小時
- 30 天內合併 PR
- 14
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
TanStack/form 的其他 Issue
-
難度 1/5 1 小時以內 新手友好度 88/100
維護者通常 1 天內回覆
-
Submit listener exceptions leave isSubmitting stuck true可能已有人在做 @henricop 於 15 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 72/100
維護者通常 1 天內回覆
-
handleSubmit calls onSubmit again while a submit is still pending (since 1.33.1)可能已有人在做 @twotnguyen 於 14 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 78/100
維護者通常 1 天內回覆
-
`isDefaultValue` is wrong when a field-level `defaultValue` is `null`可能已有人在做 @fenet-as 於 40 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 76/100
維護者通常 1 天內回覆
-
Async validator doesn't re-trigger `isValidating` after first failed validation可能已有人在做 @drewsephski 於 44 天前認領。 未關閉
難度 2/5 1-2 天 新手友好度 72/100
維護者通常 1 天內回覆
相似的 Issue
-
clawsweeper:needs-maintainer-review clawsweeper:needs-product-decision clawsweeper:no-new-fix-pr clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster P3
難度 2/5 1-3 小時 新手友好度 76/100
openclaw/openclaw#203385 · 1 則留言 · 1 個 reaction ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 72/100
nwverse/persona#12800 · 1 則留言 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 80/100
維護者通常 1 天內回覆
-
[MCP]: page snapshots in .playwright-mcp/ are not git-ignored (.playwright-cli/ is, since #42318)未關閉
難度 2/5 1-3 小時 新手友好度 62/100
microsoft/playwright#44289 ·
維護者通常 1 天內回覆
-
good first issue
難度 2/5 半天 新手友好度 65/100
維護者通常 1 天內回覆