Skip to content

Conversation

@KirtiGautam620
Copy link

Fix: Devtools show null instead of NaN (#1781)

Summary

This PR fixes an issue where TanStack Form Devtools incorrectly showed null
for fields whose value was explicitly set to Number.NaN. This caused numeric
fields that were intentionally initialized or updated to NaN to appear as
null or even disappear in the Devtools UI, making debugging confusing.

The browser correctly treats <input type="number"> with value "" as "not
set", so many users (including the reporter) map NaN -> "" when binding input
values. However, inside the form state, TanStack Form should preserve the actual
value NaN. Devtools was stringifying the value and normalizing it to null,
leading to incorrect visualization.


Problem

When a field value is Number.NaN, Devtools displays:

@changeset-bot
Copy link

changeset-bot bot commented Nov 18, 2025

⚠️ No Changeset found

Latest commit: b9487cc

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@KirtiGautam620
Copy link
Author

@tannerlinsley hi! i have worked and fixed this issue. kindly have a look over it and let me know what i can change. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant