#Struggling to implement basic routing

1 messages · Page 1 of 1 (latest)

silver mulch
silver mulch
#

Struggling to implement basic routing

hasty rampart
#

In v2 routing it will be a file named articles.1.tsx, not a folder of articles

silver mulch
#

thank you

#

do you know why it has been changed?

hardy topaz
#

I am actually struggling with routing in remix. It always says not found. But yeah imma lookup what jacob sai. Thanks.

hasty rampart
# silver mulch do you know why it has been changed?

Each route is now an “import path”, so you can treat each a bit like its own module

That means instead of just having a file, you could have a folder with the same name an an index file inside of it. Any related components or assets your route needs can also be in that folder without messing up the routing

#

That makes it much easier to keep components next to the routes that need them, which makes for much more organized projects

#

But it also means you can’t use folders for grouping routes anymore

#

There is the remix-flat-routes package you can install to get a sort of hybrid solution, where you could have a + after your folder name to make it just group the routes