You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Which package manager are you using? (Yarn is recommended)
yarn
Summary
I have a basic layout.
App Index screen app/index.tsx
Two screens with dynamic routes:
app/view/[...pathVariable].tsx
app/[...pathVariable]/index.tsx.
The first dynamic route works fine (app/view/[...pathVariable].tsx).
If I push from / to /view/foo/bar everything works as expected and the URL looks like /view/foo/bar and has no GET parameters appended (which is what I expect).
On the second dynamic route, if I push from / to /foo/bar, I land on app/[...pathVariable]/index.tsx which is correct, but now GET parameters are being appended and the URL looks like /foo/bar?pathVariable=foo&pathVariable=bar
If I navigate from / to /foo/bar and then try / again, it does not navigate to app/index.tsx screen but removes the GET parameters. (And the URL is then still: /foo/bar)
Another oddity: If I go from / to /foo/bar then to /view/foo/bar and then back to /foo/bar the screen gets rerendered and usePathname var changes from /foo/bar to /foo/bar/ (console logs twice, extra slash at end) on this screen.
Are routes like app/[...pathVariable]/index.tsx supported?
Minimal reproducible example
Here is a working codesandbox showcasing this behaviour:
Would somebody be so nice and provide me some feedback?
Is this actually a bug, a missing feature or is it working as intended and I am just using it wrong?
Which package manager are you using? (Yarn is recommended)
yarn
Summary
I have a basic layout.
app/index.tsx
app/view/[...pathVariable].tsx
app/[...pathVariable]/index.tsx
.The first dynamic route works fine (
app/view/[...pathVariable].tsx
).If I push from
/
to/view/foo/bar
everything works as expected and the URL looks like/view/foo/bar
and has no GET parameters appended (which is what I expect).On the second dynamic route, if I push from
/
to/foo/bar
, I land onapp/[...pathVariable]/index.tsx
which is correct, but now GET parameters are being appended and the URL looks like/foo/bar?pathVariable=foo&pathVariable=bar
If I navigate from
/
to/foo/bar
and then try/
again, it does not navigate toapp/index.tsx
screen but removes the GET parameters. (And the URL is then still:/foo/bar
)Another oddity: If I go from
/
to/foo/bar
then to/view/foo/bar
and then back to/foo/bar
the screen gets rerendered andusePathname
var changes from/foo/bar
to/foo/bar/
(console logs twice, extra slash at end) on this screen.Are routes like
app/[...pathVariable]/index.tsx
supported?Minimal reproducible example
Here is a working codesandbox showcasing this behaviour:
https://codesandbox.io/p/sandbox/vigilant-mclaren-zrq1kc
The text was updated successfully, but these errors were encountered: