Skip to content
Discussion options

You must be logged in to vote

Create a splat route ($.tsx). Then you can get the full path in your loader:

// routes/blog/$.tsx
export loader: LoaderFunction = async ({request, params}) => {
  const slug = params['*']
  ...
}

So for request /blog/test-series/post-1, the slug would be test-series/post-1

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@684efs3
Comment options

Answer selected by 684efs3
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