-
-
Notifications
You must be signed in to change notification settings - Fork 579
Description
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/react-form-devtools@0.2.9- observe single form entry in devtools - Upgrade to
@tanstack/react-form-devtools@0.2.11- 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/react-form-devtools@0.2.9with@tanstack/devtools-utils@0.0.9 - Broken:
@tanstack/react-form-devtools@0.2.11with@tanstack/devtools-utils@0.2.3
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.