Skip to content

[Bug]: Basename is not respected in loaders and actions redirects #9417

@manzano78

Description

@manzano78

What version of React Router are you using?

6.4.1

Steps to Reproduce

  1. Create a data browser router with some routes and a basename: createBrowserRouter(routes, { basename: '/m' });
  2. In any route, attach a loader or an action (both are impacted) which returns or throws (both are impacted) a redirect to another route represented by an absolute path: throw redirect('/some-route');

Expected Behavior

The new browser URL should be https://example.com/m/some-route

Actual Behavior

The new browser URL is https://example.com/some-route. The basename (/m) is missing, so we don't see the expected page as it couldn't match.

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