solid-router: css animations are re-triggered after query updates #8000
Send to my agentWhich project does this relate to?#
Router
Describe the bug#
When using query with solid router, the routes are remounted when the query updates which unfortunately causes CSS animations to retrigger.
https://github.com/user-attachments/assets/3bfdff81-3bcb-4a87-b626-244867b4b548
When the route mounts, the red rectangle will fade in which is expected. But after a few seconds it will re-flash again when the query updates because it seems the route DOM element is remounted.
Complete minimal reproducer#
https://github.com/PierBover/tanstack-solid-router-repro
Steps to Reproduce the Bug#
npm i && npm run dev
Then navigate between the routes.
Expected behavior#
The route should not be remounted and CSS animations should not be re-triggered. The query data should be updated reactively, probably?
Platform#
"@tanstack/solid-query": "5.101.4",
"@tanstack/solid-router": "latest",
"solid-js": "^1.9.12"
I'm on macOS Sequoia and I've seen this happening in both Chrome and Firefox.
Could you see if this https://github.com/TanStack/router/pull/8002 fixes your issue? (there are pkg-pr-new preview releases down in the PR comments where you can test the PR)
Hey @Sheraff
The issue is still there. I cloned the
tanstack-router-solid-example-basic-solid-query-file-basedwith this link.https://github.com/user-attachments/assets/6cb23ae9-2363-451d-b0a6-ae44aadcc6f8
This issue can be reproduced with only Solid and Query (and a
<Suspense>boundary) https://stackblitz.com/edit/solidjs-templates-rkxmwe15?file=src%2FApp.tsxI don't think this is a Router issue. I've forwarded this issue to the Query team.
Sheraff(GitHub profile, opens in a new tab) closed this
Sign in to join this conversation.
I've reproduced this in the official
basic-solid-query-file-basedexample.https://github.com/user-attachments/assets/7df3087f-895d-4987-b964-751cb3758b68
I added 10 seconds of stale time to the query options:
Then added a
fade-inclass to the post route to show the re-triggering of CSS animations.