Skip to content
Source
Sign inSign up
TanStack/router

fix(solid-router): preserve caller roles on enabled links #8109

MergedFnine59(GitHub profile, opens in a new tab)merged 5 commits intosolid-router-v2-pre fromrefs/pull/8109/headmerged by brenelz(GitHub profile, opens in a new tab)

Fixes #8106.

Problem

useLinkProps copies DOM-safe caller props onto the returned object, then replaces role with a getter that resolves to undefined whenever the link is enabled. That replacement removes a caller-provided role from the rendered anchor.

Fix

Keep the disabled-link override (role="link"), but otherwise read role from the caller props. Reading it in the getter preserves Solid's reactive prop semantics.

Tests

  • Added coverage for an enabled link retaining role="button", a disabled link forcing role="link", and restoring the caller role when re-enabled.
  • Ran the complete Solid Router Link test file (130 tests).
  • Ran the Solid Router build and TypeScript 5.6-7.0 type-test matrix.
  • Ran the Solid Router ESLint target and focused Prettier checks.

Reproduction

    1. coderabbitai[bot](GitHub profile, opens in a new tab)commented

      Important

      Review skipped

      Auto reviews are disabled on base/target branches other than the default branch.

      Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

      ⚙️ Run configuration

      Configuration used: defaults

      Review profile: CHILL

      Plan: Pro Plus

      Run ID: dee99a17-c887-4251-b90e-ddec484093d6

      You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

      Use the checkbox below for a quick retry:

      • 🔍 Trigger review

      Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

      ❤️ Share
      Comment `@coderabbitai help` to get the list of available commands.
    2. brenelz(GitHub profile, opens in a new tab) approved these changes

    3. nx-cloud[bot](GitHub profile, opens in a new tab)commented

      View your CI Pipeline Execution ↗ for commit 1d09a4b8b30792f3fe93d203bdc44b274924bc06

      CommandStatusDurationResult
      nx affected --targets=test:eslint,test:unit,tes...✅ Succeeded10m 10sView ↗
      nx run-many --target=build --exclude=examples/*...✅ Succeeded2m 11sView ↗

      ☁️ Nx Cloud last updated this comment at 2026-09-17 01:55:02 UTC

    4. More templates

      @tanstack/arktype-adapter

      npm i https://pkg.pr.new/@tanstack/arktype-adapter@8109

      @tanstack/eslint-plugin-router

      npm i https://pkg.pr.new/@tanstack/eslint-plugin-router@8109

      @tanstack/eslint-plugin-start

      npm i https://pkg.pr.new/@tanstack/eslint-plugin-start@8109

      @tanstack/history

      npm i https://pkg.pr.new/@tanstack/history@8109

      @tanstack/nitro-v2-vite-plugin

      npm i https://pkg.pr.new/@tanstack/nitro-v2-vite-plugin@8109

      @tanstack/react-router

      npm i https://pkg.pr.new/@tanstack/react-router@8109

      @tanstack/react-router-devtools

      npm i https://pkg.pr.new/@tanstack/react-router-devtools@8109

      @tanstack/react-router-ssr-query

      npm i https://pkg.pr.new/@tanstack/react-router-ssr-query@8109

      @tanstack/react-start

      npm i https://pkg.pr.new/@tanstack/react-start@8109

      @tanstack/react-start-client

      npm i https://pkg.pr.new/@tanstack/react-start-client@8109

      @tanstack/react-start-rsc

      npm i https://pkg.pr.new/@tanstack/react-start-rsc@8109

      @tanstack/react-start-server

      npm i https://pkg.pr.new/@tanstack/react-start-server@8109

      @tanstack/router-cli

      npm i https://pkg.pr.new/@tanstack/router-cli@8109

      @tanstack/router-core

      npm i https://pkg.pr.new/@tanstack/router-core@8109

      @tanstack/router-devtools

      npm i https://pkg.pr.new/@tanstack/router-devtools@8109

      @tanstack/router-devtools-core

      npm i https://pkg.pr.new/@tanstack/router-devtools-core@8109

      @tanstack/router-generator

      npm i https://pkg.pr.new/@tanstack/router-generator@8109

      @tanstack/router-plugin

      npm i https://pkg.pr.new/@tanstack/router-plugin@8109

      @tanstack/router-ssr-query-core

      npm i https://pkg.pr.new/@tanstack/router-ssr-query-core@8109

      @tanstack/router-utils

      npm i https://pkg.pr.new/@tanstack/router-utils@8109

      @tanstack/router-vite-plugin

      npm i https://pkg.pr.new/@tanstack/router-vite-plugin@8109

      @tanstack/solid-router

      npm i https://pkg.pr.new/@tanstack/solid-router@8109

      @tanstack/solid-router-devtools

      npm i https://pkg.pr.new/@tanstack/solid-router-devtools@8109

      @tanstack/solid-router-ssr-query

      npm i https://pkg.pr.new/@tanstack/solid-router-ssr-query@8109

      @tanstack/solid-start

      npm i https://pkg.pr.new/@tanstack/solid-start@8109

      @tanstack/solid-start-client

      npm i https://pkg.pr.new/@tanstack/solid-start-client@8109

      @tanstack/solid-start-server

      npm i https://pkg.pr.new/@tanstack/solid-start-server@8109

      @tanstack/start-client-core

      npm i https://pkg.pr.new/@tanstack/start-client-core@8109

      @tanstack/start-fn-stubs

      npm i https://pkg.pr.new/@tanstack/start-fn-stubs@8109

      @tanstack/start-plugin-core

      npm i https://pkg.pr.new/@tanstack/start-plugin-core@8109

      @tanstack/start-server-core

      npm i https://pkg.pr.new/@tanstack/start-server-core@8109

      @tanstack/start-static-server-functions

      npm i https://pkg.pr.new/@tanstack/start-static-server-functions@8109

      @tanstack/start-storage-context

      npm i https://pkg.pr.new/@tanstack/start-storage-context@8109

      @tanstack/valibot-adapter

      npm i https://pkg.pr.new/@tanstack/valibot-adapter@8109

      @tanstack/virtual-file-routes

      npm i https://pkg.pr.new/@tanstack/virtual-file-routes@8109

      @tanstack/vue-router

      npm i https://pkg.pr.new/@tanstack/vue-router@8109

      @tanstack/vue-router-devtools

      npm i https://pkg.pr.new/@tanstack/vue-router-devtools@8109

      @tanstack/vue-router-ssr-query

      npm i https://pkg.pr.new/@tanstack/vue-router-ssr-query@8109

      @tanstack/vue-start

      npm i https://pkg.pr.new/@tanstack/vue-start@8109

      @tanstack/vue-start-client

      npm i https://pkg.pr.new/@tanstack/vue-start-client@8109

      @tanstack/vue-start-server

      npm i https://pkg.pr.new/@tanstack/vue-start-server@8109

      @tanstack/zod-adapter

      npm i https://pkg.pr.new/@tanstack/zod-adapter@8109

      commit: 1d09a4b

    5. Hooray! CodSpeed harness just leveled up!

      The base and head of this comparison were measured with different runner settings, so their benchmark values are not directly comparable.

      What changed between base and head:

      Re-run the base with the same settings to get a valid performance comparison.


      Comparing Fnine59:fix/tanstack-router-solid-link-role-8106 (1d09a4b) with solid-router-v2-pre (67a9040)[^unexpected-base] Open in CodSpeed

Sign in to join this conversation.