Skip to content

Splat Route's inside pathless layout routes break with "-" at the start of the URL #8561

@ryanflorence

Description

@ryanflorence

What version of React Router are you using?

v6

Steps to Reproduce

https://stackblitz.com/edit/splat-route-dash-bug?file=src/App.tsx

<Routes>
  <Route element={<Layout />}>
    <Route path="*" element={<Splat />} />
  </Route>
</Routes>

Visit /-anything that starts with a "-".

Expected Behavior

Splat route should render at "/-splat"

Actual Behavior

Blank page, "no routes match" in the console.

Note that if you remove the pathless layout route above the splat it works fine.

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