Skip to content

Commit caebeb2

Browse files
docs: Added guide on combining configure routes and file routes (#12618)
* docs: Added guide on combining `configure routes` and `file routes` * Update docs/start/framework/routing.md --------- Co-authored-by: Brooks Lybrand <[email protected]>
1 parent a005851 commit caebeb2

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

docs/start/framework/routing.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,18 @@ export default [
4949
] satisfies RouteConfig;
5050
```
5151

52-
If you prefer to define your routes via file naming conventions rather than configuration, the `@react-router/fs-routes` package provides a [file system routing convention.][file-route-conventions]
52+
If you prefer to define your routes via file naming conventions rather than configuration, the `@react-router/fs-routes` package provides a [file system routing convention][file-route-conventions]. You can even combine different routing conventions if you like:
53+
54+
```ts filename=app/routes.ts
55+
import { type RouteConfig, route } from "@react-router/dev/routes";
56+
import { flatRoutes } from "@react-router/fs-routes";
57+
58+
export default = [
59+
route("/", "./home.tsx"),
60+
61+
...await flatRoutes(),
62+
] satisfies RouteConfig;
63+
```
5364

5465
## Route Modules
5566

0 commit comments

Comments
 (0)