From b4b15046e95140e08fb982ee2c98f09bf258d735 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Cederstr=C3=B6m?= Date: Fri, 6 Dec 2024 13:27:48 +0100 Subject: [PATCH] update docs about catch all routes (#175) --- packages/rescript-relay-router/README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/packages/rescript-relay-router/README.md b/packages/rescript-relay-router/README.md index 5ef7a39..ccb3f3b 100644 --- a/packages/rescript-relay-router/README.md +++ b/packages/rescript-relay-router/README.md @@ -148,6 +148,17 @@ Route names must: Any routes put in another route's `children` is _nested_. In the example above, this means that the `Organization` route controls rendering of all of its child routes. This enables nested layouts, where layouts can stay rendered and untouched as URL changes in ways that does not affect them. +To create a "catch all" route, use the `*`, character as the route path. Typically used for the "not found" route. Example: + +```json +[ + { + "name": "NotFound", + "path": "*" + } +] +``` + > The router uses the matching logic from [`react-router`](https://reactrouter.com/docs/en/v6) under the hood. ### Route renderers