Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(bug): Date values becoming stale #167

Open
nikolovlazar opened this issue Feb 22, 2025 · 2 comments
Open

(bug): Date values becoming stale #167

nikolovlazar opened this issue Feb 22, 2025 · 2 comments

Comments

@nikolovlazar
Copy link
Contributor

nikolovlazar commented Feb 22, 2025

Describe the bug

I noticed that Date values get stale between navigation (tanstack router) and their values lag behind, while their String representation is correct.

Steps to Reproduce the Bug or Issue

  1. Reproduction: https://stackblitz.com/edit/github-99msu7h8?file=src%2Froutes%2Findex.tsx
  2. Note the String Value and Date Value labels in the preview
  3. Note the Date should be [date] label below the horizontal rule
  4. The home page sets the date to 22nd March 2025, the About page sets it to 17th March, 2025
  5. The default Date value is Fri Dec 31 1999. You can see that on the initial page load the String value gets returned correctly from the useState hook, while the Date value remains the default (1999)
  6. Start navigating between Home and About
  7. You'll see that the Date value becomes stale and gets out of sync (shows date for previous page), while the String value and Date should be are in sync

Expected behavior

I expect the Date value to remain in sync and not become stale

Screenshots or Videos

No response

Platform

  • OS: macOS
  • Browser: Brave
  • Version: 1.75.180

Additional context

No response

@crutchcorn
Copy link
Member

Dupe of #160

@nikolovlazar
Copy link
Contributor Author

nikolovlazar commented Feb 22, 2025

#164 seems like it fixes the issue! I tried it locally and the Date values aren't becoming stale.

CleanShot.2025-02-22.at.09.58.29.mp4

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

No branches or pull requests

2 participants