Open typeofweb opened 1 year ago
@leerob @ijjk @timneutkens Guys I guess this is a real issue and bug that need a fix. Almost one year ago that this has been opened :x
@typeofweb since it's been a year and this is unresolved, have you made a workaround?
You can do workaround with a bit of algorithmic, either using usePathname or using those hooks but filtering output removing things with ()
Verify canary release
Provide environment information
Which area(s) of Next.js are affected? (leave empty if unsure)
App directory (appDir: true)
Link to the code that reproduces this issue or a replay of the bug
https://codesandbox.io/p/sandbox/wandering-hill-3f5rtr?file=%2Fapp%2F%28group%29%2Fsome-route%2Fpage.tsx
To Reproduce
useSelectedLayoutSegment
oruseSelectedLayoutSegments
(or just visit the above codesandbox and navigate to
/some-route
: https://3f5rtr-3000.csb.app/some-routeDescribe the Bug
useSelectedLayoutSegment()
returns"(group)"
useSelectedLayoutSegments()
returns["(group)", "some-route"]
Expected Behavior
useSelectedLayoutSegment()
returns"some-route"
useSelectedLayoutSegments()
returns["some-route"]
Which browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response