- Notifications
You must be signed in to change notification settings - Fork65
Open
Description
Describe the Bug
I encountered a bit of a strange bug recently in"@generouted/react-router"
When an optional param is present in a flat route file path (e.g.pages/foo.-[bar].tsx) the route crashes with a"Not found" error.
However, if I nest the optional segment in a directorypages/foo/-[bar].tsx, all is well.
Generouted Version
@generouted/react-router@1.19.3
Your Example Website or App or Reproduction
https://codesandbox.io/p/github/joshuagraber/generouted-optional-params-bug/main
Steps to Reproduce the Bug or Issue
- Run app
- Click the links in the index route
- Observe the
/fooroute (flat) breaking, and the/barroute (nested) working as expected.
Expected Behavior
I would expect that flat routes with optional route params defined with valid generouted syntax would render the default export.
Screenshots or Videos
Screen.Recording.2025-03-11.at.2.22.37.PM.mov
Platform
- OS: macOS
- Browser: Chrome, Firefox
- Browser version: FF developer edition 137.0b4, Chrome 134.0.6998.88
Additional context
No response
Metadata
Metadata
Assignees
Labels
No labels