Skip to content

[Bug]: SSR breaks absolute URLs in Link components #10094

Closed
@fenok

Description

@fenok

What version of React Router are you using?

6.8.1

Steps to Reproduce

SSR a <Link /> component with an absolute URL like this:

<Link to="https://www.google.com">Google</Link>

Expected Behavior

The link is recognized to be external and rendered like this:

<a href="https://www.google.com">Google</a>

Actual Behavior

The link is considered internal and rendered like this:

<a href="/https://www.google.com">Google</a>

Basically, this check makes the <Link/> component not SSR-friendly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions