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

fix(react-router): on initial load the `router.state.status` does not transition to "idle" #1559

Closed SeanCassiere closed 2 weeks ago

SeanCassiere commented 2 weeks ago

On the initial load, the router's status does not transition back to "idle". This was working correctly prior to the 1.28.8 release.

Turns out, that the usePrevious hook used by the <RouterProvider>, wasn't actually storing the previous value so the conditions for firing the events were never met during the initial load.

Fixes #1552

nx-cloud[bot] commented 2 weeks ago

☁️ Nx Cloud Report

CI is running/has finished running commands for commit ce3248c7f0b11d61e465b337777589485a093265. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 2 targets - [`nx affected --targets=test:format,test:eslint,test:unit,test:build,build --parallel=3`](https://cloud.nx.app/runs/F6Iq3CDn8y?utm_source=pull-request&utm_medium=comment) - [`nx affected --target=test:types --exclude=examples/**`](https://cloud.nx.app/runs/utDXcdYyed?utm_source=pull-request&utm_medium=comment)

Sent with 💌 from NxCloud.

SeanCassiere commented 2 weeks ago

Tanner mentioned this should be done in the router events and its possibly an event that's not firing correctly.