You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you have other ESLint plugins installed, they may rules that conflict with this plugin. If so, you'll need to make some tweaks to allow these plugins to work together.
110
+
111
+
### `typescript-eslint`
112
+
113
+
The [`@typescript-eslint/only-throw-error`](https://typescript-eslint.io/rules/only-throw-error/) rule, enabled by default in the `recommended-type-checked` and `strict-type-checked` rulesets, disallows the throwing of non-Error values as exceptions, which is considered a good practice.
114
+
115
+
To make sure it that it does not conflict with TanStack Router, you should add `redirect` to the allowed as a throwable objects.
Copy file name to clipboardExpand all lines: docs/router/framework/react/api/router/NotFoundErrorType.md
+13-6Lines changed: 13 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,33 +11,40 @@ export type NotFoundError = {
11
11
data?:any
12
12
throw?:boolean
13
13
routeId?:string
14
+
headers?:HeadersInit
14
15
}
15
16
```
16
17
17
18
## NotFoundError properties
18
19
19
20
The `NotFoundError` object accepts/contains the following properties:
20
21
22
+
### `global` property (⚠️ deprecated, use `routeId:rootRouteId` instead)
23
+
24
+
- Type: `boolean`
25
+
- Optional - `default:false`
26
+
- If true, the not-found error will be handled by the `notFoundComponent` of the root route instead of bubbling up from the route that threw it. This has the same behavior as importing the root route and calling `RootRoute.notFound()`.
27
+
21
28
### `data` property
22
29
23
30
- Type: `any`
24
31
- Optional
25
32
- Custom data that is passed into to `notFoundComponent` when the not-found error is handled
26
33
27
-
### `global` property
34
+
### `throw` property
28
35
29
36
- Type: `boolean`
30
37
- Optional - `default:false`
31
-
- If true, the not-found error will be handled by the `notFoundComponent` of the root route instead of bubbling up from the route that threw it. This has the same behavior as importing the root route and calling `RootRoute.notFound()`.
38
+
- If provided, will throw the not-found object instead of returning it. This can be useful in places where `throwing` in a function might cause it to have a return type of `never`. In that case, you can use `notFound({ throw:true })` to throw the not-found object instead of returning it.
32
39
33
40
### `route` property
34
41
35
42
- Type: `string`
36
43
- Optional
37
44
- The ID of the route that will attempt to handle the not-found error. If the route does not have a `notFoundComponent`, the error will bubble up to the parent route (and be handled by the root route if necessary). By default, TanStack Router will attempt to handle the not-found error with the route that threw it.
38
45
39
-
### `throw` property
46
+
### `headers` property
40
47
41
-
- Type: `boolean`
42
-
- Optional - `default:false`
43
-
- If provided, will throw the not-found object instead of returning it. This can be useful in places where `throwing` in a function might cause it to have a return type of `never`. In that case, you can use `notFound({ throw:true })` to throw the not-found object instead of returning it.
48
+
- Type: `HeadersInit`
49
+
- Optional
50
+
- HTTP headers to be included when the not-found error is handled on the server side.
Copy file name to clipboardExpand all lines: docs/router/framework/react/faq.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ Welcome to the TanStack Router FAQ! Here you'll find answers to common questions
6
6
7
7
## Should I commit my `routeTree.gen.ts` file into git?
8
8
9
-
Yes! Although the route tree file (i.e. `routeTree.gen.ts`) is generated by the TanStack Router, it is essentially towards the runtime of your application. It is not a build artifact. The route tree file is a critical part of your application's source code, and it is used by the TanStack Router to build your application's routes at runtime.
9
+
Yes! Although the route tree file (i.e.,`routeTree.gen.ts`) is generated by TanStack Router, it is essentially part of your application’s runtime, not a build artifact. The route tree file is a critical part of your application’s source code, and it is used by TanStack Router to build your application’s routes at runtime.
10
10
11
11
You should commit this file into git so that other developers can use it to build your application.
Copy file name to clipboardExpand all lines: docs/start/framework/react/getting-started.md
+1-2Lines changed: 1 addition & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,6 @@ title: Getting Started
5
5
6
6
To set up a TanStack Start project, you can:
7
7
8
-
<!-- - Use the [TanStack Start CLI](https://github.com/tanstack/start/tree/main/packages/start-cli) to generate a new project and learn as you go -->
9
-
8
+
- Use the [TanStack Start CLI](https://github.com/TanStack/create-tsrouter-app/blob/main/cli/create-start-app/README.md) via `npx create-start-app@latest`
10
9
- Use the [Quick Start Examples](../quick-start) to rapidly learn as you go
11
10
-[Build a project from scratch](../build-from-scratch) to learn how TanStack Start works from the ground up
0 commit comments