router icon indicating copy to clipboard operation
router copied to clipboard

The target prop is not passed to external links

Open arthurflachs opened this issue 2 years ago • 0 comments

Describe the bug

Adding a prop target="_blank" on an external link (= full URL) is not supported. The only prop passed is href.

Your Example Website or App

https://github.com/TanStack/router/compare/main...arthurflachs:router:fix/target-blank-external

Steps to Reproduce the Bug or Issue

  1. Run the basic example and add an external link with target="_blank"
  2. The attribute is not passed to the rendered link

Expected behavior

The attribute should be passed to the HTML link, and open in a new window/tab.

Screenshots or Videos

No response

Platform

Any platform

  • Version: latest (1.4.6)

Additional context

https://github.com/TanStack/router/compare/main...arthurflachs:router:fix/target-blank-external

This fixes the bug, however I feel this is too minimal : other props might need to be passed.

arthurflachs avatar Jan 15 '24 15:01 arthurflachs