Skip to content

Commit 16de974

Browse files
fix docs
closes #2929
1 parent 5b8480d commit 16de974

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

‎docs/router/guide/not-found-errors.md‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ There are 2 uses for not-found errors in TanStack Router:
1010

1111
- **Non-matching route paths**: When a path does not match any known route matching pattern **OR** when it partially matches a route, but with extra path segments
1212
- The **router** will automatically throw a not-found error when a path does not match any known route matching pattern
13-
- If the router's `notFoundMode` is set to `fuzzy`, the nearest parent route with a `notFoundComponent` will handle the error. If the router's `notFoundMode` is set to `root`, the root route will handle the error.
13+
- If the router's `notFoundMode` is set to `fuzzy`, the nearest matching route with a `notFoundComponent` will handle the error. If the router's `notFoundMode` is set to `root`, the root route will handle the error.
1414
- Examples:
1515
- Attempting to access `/users` when there is no `/users` route
1616
- Attempting to access `/posts/1/edit` when the route tree only handles `/posts/$postId`
1717
- **Missing resources**: When a resource cannot be found, such as a post with a given ID or any asynchronous data that is not available or does not exist
1818
- **You, the developer** must throw a not-found error when a resource cannot be found. This can be done in the `beforeLoad` or `loader` functions using the `notFound` utility.
19-
- Will be handled by the nearest parent route with a `notFoundComponent` (when `notFound` is called within `loader`) or the root route.
19+
- Will be handled by the nearest matching route with a `notFoundComponent` (when `notFound` is called within `loader`) or the root route.
2020
- Examples:
2121
- Attempting to access `/posts/1` when the post with ID 1 does not exist
2222
- Attempting to access `/docs/path/to/document` when the document does not exist
@@ -34,13 +34,12 @@ Depending on the `notFoundMode` option, the router will handle these automatic e
3434

3535
### `notFoundMode: 'fuzzy'`
3636

37-
By default, the router's `notFoundMode` is set to `fuzzy`, which indicates that if a pathname doesn't match any known route, the router will attempt to use the closest matching route with children/(an outlet) and a configured not found component.
37+
By default, the router's `notFoundMode` is set to `fuzzy`, which indicates that if a pathname doesn't match any known route, the router will attempt to use the closest matching route with a configured `notFoundComponent`.
3838

3939
> **❓ Why is this the default?** Fuzzy matching to preserve as much parent layout as possible for the user gives them more context to navigate to a useful location based on where they thought they would arrive.
4040
4141
The nearest suitable route is found using the following criteria:
4242

43-
- The route must have children and therefore an `Outlet` to render the `notFoundComponent`
4443
- The route must have a `notFoundComponent` configured or the router must have a `defaultNotFoundComponent` configured
4544

4645
For example, consider the following route tree:
@@ -53,9 +52,10 @@ If provided the path of `/posts/1/edit`, the following component structure will
5352

5453
- `<Root>`
5554
- `<Posts>`
56-
- `<Posts.notFoundComponent>`
55+
- `<Post>`
56+
- `<Post.notFoundComponent>`
5757

58-
The `notFoundComponent` of the `posts` route will be rendered because it is the **nearest suitable parent route with children (and therefore an outlet) and a `notFoundComponent` configured**.
58+
The `notFoundComponent` of the `$postId` route will be rendered because it is the **nearest matching route with a `notFoundComponent` configured**.
5959

6060
### `notFoundMode: 'root'`
6161

0 commit comments

Comments
 (0)