Skip to content

Keep NavLink inactive in the SPA fallback - #15818

Merged
brophdawg11 merged 4 commits into
mainfrom
brophdawg11/codex-spa-fallback-navlink
Nov 23, 2026
Merged

brophdawg11 merged 4 commits into
mainfrom
brophdawg11/codex-spa-fallback-navlink

Conversation

@brophdawg11

Copy link
Copy Markdown
Contributor

Keep NavLink inactive in the Framework SPA fallback and during each link’s first hydration render. The fallback serves the same HTML for every URL, so a direct visit to /other can otherwise keep the Home link’s prerendered active class and aria-current.

After hydration, each link computes its active state from the browser URL. This also works when a menu hydrates later inside Suspense. The regression test covers the fallback markup, a direct load of /other, and subsequent client navigation.

Closes #13010. Related to #15576.

Testing

  • Local browser verification used an installed Chromium build because Playwright’s pinned binary exited on launch.

@github-actions

Copy link
Copy Markdown
Contributor

Preview Build Available

Preview builds have been created for this PR. You can install react-router using:

pnpm install "remix-run/react-router#preview/pr-15818&path:packages/react-router"

And/or install other packages via:

pnpm install "remix-run/react-router#preview/pr-15818&path:packages/react-router-dev"
pnpm install "remix-run/react-router#preview/pr-15818&path:packages/react-router-express"
pnpm install "remix-run/react-router#preview/pr-15818&path:packages/react-router-node"
pnpm install "remix-run/react-router#preview/pr-15818&path:packages/react-router-serve"

These preview builds will be updated automatically as you push new commits.

@brophdawg11
brophdawg11 marked this pull request as ready for review November 23, 2026 18:46
@brophdawg11
brophdawg11 merged commit 0adfd8e into main Nov 23, 2026
12 checks passed
@brophdawg11
brophdawg11 deleted the brophdawg11/codex-spa-fallback-navlink branch November 23, 2026 19:14
@github-actions

Copy link
Copy Markdown
Contributor

The preview branch preview/pr-15818 has been deleted now that this PR is merged/closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SPA Mode + <NavLink to="/" end> rendered in root.tsx Layout component will always start as "active"

1 participant