Skip to content

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

Open
Fnine59 wants to merge 2 commits into
TanStack:solid-router-v2-prefrom
Fnine59:fix/tanstack-router-solid-link-role-8106
Open

fix(solid-router): preserve caller roles on enabled links#8109
Fnine59 wants to merge 2 commits into
TanStack:solid-router-v2-prefrom
Fnine59:fix/tanstack-router-solid-link-role-8106

Conversation

@Fnine59

@Fnine59 Fnine59 commented Aug 18, 2026

Copy link
Copy Markdown

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.

@coderabbitai

coderabbitai Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

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: dcabcec3-3494-4c19-8403-f4fa80fcc6d9

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.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant