Skip to content

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

@lyzno1

Description

@lyzno1

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/react-form-devtools@0.2.9 - observe single form entry in devtools
  3. 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

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

  • Working: @tanstack/react-form-devtools@0.2.9 with @tanstack/devtools-utils@0.0.9
  • Broken: @tanstack/react-form-devtools@0.2.11 with @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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions