Repository navigation
group feature in folder based routing #15502
wael-amrany
started this conversation in
Proposals
Replies: 2 comments 1 reply
|
If you're using import type { RouteConfig } from "@react-router/dev/routes";
import { prefix } from "@react-router/dev/routes";
import { flatRoutes } from "@react-router/fs-routes";
let [publicRoutes, appRoutes, apiRoutes, actionRoutes] = await Promise.all([
flatRoutes({ rootDirectory: "./routes/public" }),
flatRoutes({ rootDirectory: "./routes/app" }),
flatRoutes({ rootDirectory: "./routes/api" }),
flatRoutes({ rootDirectory: "./routes/actions" }),
]);
export default [
...publicRoutes,
...prefix("/app", appRoutes),
...prefix("/api", apiRoutes),
...prefix("/actions", actionRoutes),
] satisfies RouteConfig; |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

Uh oh!
There was an error while loading. Please reload this page.
like if i have multiple nested routes the project become big and hard to navigate in so you should add grouping route to group multiple routes like next.js (storefront) ,(dashboard), (landing), (Auth)
All reactions