kiliman / remix-flat-routes

Remix package to define routes using the flat-routes convention
MIT License
640 stars 22 forks source link

How to match all descending paths? #97

Closed adaboese closed 6 months ago

adaboese commented 6 months ago

I want to match /images/$anythingThatFollows

I tried /routes/images/$path, but it matches only the first path segment, i.e. it won't work with /images/foo/bar/baz.jpg

kiliman commented 6 months ago

Try routes/images.$.tsx

The $ by itself is a splat route and matches everything, including /.

You access it from your loader using params['*']

https://remix.run/docs/en/main/file-conventions/routes#splat-routes

adaboese commented 6 months ago

That's it. Thank you!