TanStack / router

🤖 Fully typesafe Router for React (and friends) w/ built-in caching, 1st class search-param APIs, client-side cache integration and isomorphic rendering.
https://tanstack.com/router
MIT License
7.19k stars 486 forks source link

router status never changes from "pending" #1552

Closed SeanCassiere closed 2 weeks ago

SeanCassiere commented 2 weeks ago

Describe the bug

From a Discord thread: https://discord.com/channels/719702312431386674/1235498104317284372

The Router's status never changes from "pending".

So when you use this code-snippet, it always stays as "pending" even after the page has loaded.

const status = useRouterState({ select: (s) => s.status });

Your Example Website or App

https://stackblitz.com/edit/github-zdscfw-ekwvlx?file=src%2Froutes%2Findex.tsx

Steps to Reproduce the Bug or Issue

  1. Go to /
  2. Observe the status remains as "pending" even after the page has completed loading.

Expected behavior

As per the reference documentation, it should return to "idle" once done.

https://tanstack.com/router/latest/docs/framework/react/api/router/RouterStateType#status-property

Screenshots or Videos

No response

Platform

Additional context

"I bisected the versions, and it looks like it was introduced in v1.28.8. We've pinned to v1.28.1, so I didn't notice before" - Jakob Norlin