Skip to content

Dynamic Segment Ignored #929

Answered by schiller-manuel
allan-vera asked this question in Q&A
Discussion options

You must be logged in to vote

Can you put the example up on e.g. codesandbox or a git repo? Trying to guess from some screenshots is not so great.
However, it looks like the routing works as expected?
users/2 => users/$userID
users/ => users/

What's the actual issue?
Is it that UserDetailPage is used in both routes?
How about:

const usersRoute = new Route({
  getParentRoute: () => rootRoute,
  path: "users",
});
export const userDetailRoute = new Route({
  getParentRoute: () => usersRoute,
  path: "$userId",
  component: UserDetailPage,
  beforeLoad: (data) => protectRoute(data),
});
export const userIndexRoute = new Route({
  getParentRoute: () => usersRoute,
  path: "/",
  component: UsersPage,
  beforeLoad: (data) => 

Replies: 2 comments 8 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
8 replies
@allan-vera
Comment options

@allan-vera
Comment options

@allan-vera
Comment options

@schiller-manuel
Comment options

Answer selected by allan-vera
@allan-vera
Comment options

@allan-vera
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants