Skip to content

Missing optional param when using pathless layoutes #6012

@JohanDavidsson

Description

@JohanDavidsson

Which project does this relate to?

Router

Describe the bug

I have two pathless layoutes. Both have a optional language param route in them. When one of them gets matched the param is missing from useParams.

Your Example Website or App

https://stackblitz.com/edit/github-fkabbqxu?file=src%2Froutes%2F__root.tsx

Steps to Reproduce the Bug or Issue

  1. Go to link "/sv (first pathless)"
  2. See useParams returns nothing, should return {language: "sv"}

Expected behavior

useParams should, if i'm not mistaking, return {language: "sv"}, but returns nothing.

Screenshots or Videos

No response

Platform

  • Router / Start Version: 1.139.12.
  • OS: macOS
  • Browser: Chrome
  • Browser Version: 142
  • Bundler: Vite
  • Bundler Version: 7.1.2

Additional context

Stopped working when updating from 1.131.36 to 1.139.12. Worked as expected in 1.131.36

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions