TanStack / TanStack/router

Active Link css transition flickering

Open
#6,041 15 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
15.1k
Forks
1.9k
Avg merge
1d 20h
Merged PRs (30d)
143

Description

Which project does this relate to?

Router

Describe the bug

When styling the active link with a color transition, the previously active link is occasionally styled incorrectly. It briefly flickers with the previous colors for less than a second. This happens rarely (maybe 1 in 30 navigations). I’m not sure whether the bug is caused by the tanstack router or by CSS itself.

Your Example Website or App

https://github.com/idonotknowwhoiam/tanstackrouter-repro

Steps to Reproduce the Bug or Issue
  1. Clone the repository.
  2. Start the server (dev/preview).
  3. Navigate between pages, occasionally refreshing the browser (this may or may not influence the issue idk).
Expected behavior

The active link should switch styles without any flickering.

Screenshots or Videos

https://github.com/user-attachments/assets/f503d530-4646-41ba-a5c4-18850d70a4f7

Platform
  • Router / Start Version: 1.139.12
  • OS: macOS
  • Browser: Chrome, Arc
  • Browser Version: 142.0.7444.177
  • Bundler: Vite
  • Bundler Version: 7.1.7
Additional context

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by cloning the linked tanstackrouter-repro application and reproduce the intermittent flicker while navigating between pages in the listed browsers. Trace the router's active-link styling behavior alongside the CSS transition; done means identifying whether the router or CSS causes the flicker and preventing it during navigation.

Written by the indexing model from the issue text.

Assessment

Tech stack
css, typescript, vite
Domain
frontend, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.