#How to create nested routes with v2 file naming

1 messages · Page 1 of 1 (latest)

waxen swan
#

Hey! How can I create nested layouts with v2 file naming convention? I am so confused with these underscore namings and how could I make multiple nested layouts in one route?

For example, I could have _quiz.tsx and _results.tsx layouts, how can I create a route such as /quiz/some-name/results where a _results layout would be nested inside _quiz layout?

umbral gust
#
/quiz.tsx
/quiz.some-name.results.tsx

Would be equivalent to

<Quiz >
<Quiz.Some-name.Results />
</Quiz>

waxen swan
umbral gust
#

If you're used to v1 routing, then the big changes are

  • nested folders / becomes .
  • dot limiter . becomes trailing _
#

I think @hexed tusk 's Remix Forge have an auto v1 to v2 route converter? I haven't played with that feature yet.

hexed tusk
#

Yes

#

I tested it on a big ass project with 100+ routes so you should have no issues