Skip to content

Commit 1cd9176

Browse files
authored
docs(router): using square brackets for character escaping (#4753)
1 parent c35d414 commit 1cd9176

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

docs/router/framework/react/routing/file-naming-conventions.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ File-based routing requires that you follow a few simple file naming conventions
1313
| **`_` Suffix** | Route segments with the `_` suffix exclude the route from being nested under any parent routes. |
1414
| **`-` Prefix** | Files and folders with the `-` prefix are excluded from the route tree. They will not be added to the `routeTree.gen.ts` file and can be used to colocate logic in route folders. |
1515
| **`(folder)` folder name pattern** | A folder that matches this pattern is treated as a **route group**, preventing the folder from being included in the route's URL path. |
16+
| **`[x]` Escaping** | Square brackets escape special characters in filenames that would otherwise have routing meaning. For example, `script[.]js.tsx` becomes `/script.js` and `api[.]v1.tsx` becomes `/api.v1`. |
1617
| **`index` Token** | Route segments ending with the `index` token (before any file extensions) will match the parent route when the URL pathname matches the parent route exactly. This can be configured via the `indexToken` configuration option, see [options](../../../../api/file-based-routing.md#indextoken). |
1718
| **`.route.tsx` File Type** | When using directories to organise routes, the `route` suffix can be used to create a route file at the directory's path. For example, `blog.post.route.tsx` or `blog/post/route.tsx` can be used as the route file for the `/blog/post` route. This can be configured via the `routeToken` configuration option, see [options](../../../../api/file-based-routing.md#routetoken). |
1819

0 commit comments

Comments
 (0)