Skip to content

Commit f8910f0

Browse files
authored
Merge branch 'main' into route-generator/dont-remove-trailing-slash-for-root
2 parents e6bf332 + 3e6e9e7 commit f8910f0

File tree

369 files changed

+25914
-1254
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

369 files changed

+25914
-1254
lines changed

docs/router/framework/react/api/router.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ title: Router API
3232
- [`<Link>`](../router/linkComponent.md)
3333
- [`<MatchRoute>`](../router/matchRouteComponent.md)
3434
- [`<Navigate>`](../router/navigateComponent.md)
35+
- [`<NotFoundComponent>`](../router/notFoundComponentComponent.md)
3536
- [`<Outlet>`](../router/outletComponent.md)
3637
- Hooks
3738
- [`useAwaited`](../router/useAwaitedHook.md)
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
id: notFoundComponentComponent
3+
title: NotFoundComponent component
4+
---
5+
6+
The `NotFoundComponent` component is a component that renders when a not-found error occurs in a route.
7+
8+
## NotFoundComponent props
9+
10+
The `NotFoundComponent` component accepts the following props:
11+
12+
### `props.data` prop
13+
14+
- Type: `unknown`
15+
- Optional
16+
- Custom data that is passed to the `notFoundComponent` when the not-found error is handled
17+
- This data comes from the `data` property of the `NotFoundError` object
18+
19+
### `props.isNotFound` prop
20+
21+
- Type: `boolean`
22+
- Required
23+
- A boolean value indicating whether the current state is a not-found error state
24+
- This value is always `true`
25+
26+
### `props.routeId` prop
27+
28+
- Type: `RouteIds<RegisteredRouter['routeTree']>`
29+
- Required
30+
- The ID of the route that is attempting to handle the not-found error
31+
- Must be one of the valid route IDs from the router's route tree
32+
33+
## NotFoundComponent returns
34+
35+
- Returns appropriate UI for not-found error situations
36+
- Typically includes a "page not found" message along with links to go home or navigate to previous pages

e2e/react-router/basepath-file-based/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"dev": "vite --port 3000",
77
"dev:e2e": "vite",
88
"build": "vite build && tsc --noEmit",
9-
"serve": "vite preview",
9+
"preview": "vite preview",
1010
"start": "vite",
1111
"test:e2e": "rm -rf port*.txt; playwright test --project=chromium"
1212
},

e2e/react-router/basepath-file-based/playwright.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export default defineConfig({
2626
},
2727

2828
webServer: {
29-
command: `VITE_NODE_ENV="test" VITE_SERVER_PORT=${PORT} VITE_EXTERNAL_PORT=${EXTERNAL_PORT} pnpm build && VITE_SERVER_PORT=${PORT} pnpm serve --port ${PORT}`,
29+
command: `VITE_NODE_ENV="test" VITE_SERVER_PORT=${PORT} VITE_EXTERNAL_PORT=${EXTERNAL_PORT} pnpm build && VITE_SERVER_PORT=${PORT} pnpm preview --port ${PORT}`,
3030
url: baseURL,
3131
reuseExistingServer: !process.env.CI,
3232
stdout: 'pipe',

e2e/react-router/basic-file-based-code-splitting/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"dev": "vite --port 3000",
77
"dev:e2e": "vite",
88
"build": "vite build && tsc --noEmit",
9-
"serve": "vite preview",
9+
"preview": "vite preview",
1010
"start": "vite",
1111
"test:e2e:verbose-routes:true": "rm -rf port*.txt; VERBOSE_FILE_ROUTES=1 playwright test --project=chromium",
1212
"test:e2e:verbose-routes:false": "rm -rf port*.txt; VERBOSE_FILE_ROUTES=0 playwright test --project=chromium",

e2e/react-router/basic-file-based-code-splitting/playwright.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export default defineConfig({
2626
},
2727

2828
webServer: {
29-
command: `VITE_NODE_ENV="test" VITE_SERVER_PORT=${PORT} VITE_EXTERNAL_PORT=${EXTERNAL_PORT} pnpm build && pnpm serve --port ${PORT}`,
29+
command: `VITE_NODE_ENV="test" VITE_SERVER_PORT=${PORT} VITE_EXTERNAL_PORT=${EXTERNAL_PORT} pnpm build && pnpm preview --port ${PORT}`,
3030
url: baseURL,
3131
reuseExistingServer: !process.env.CI,
3232
stdout: 'pipe',

e2e/react-router/basic-file-based/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
"dev:e2e": "vite",
99
"build": "vite build && tsc --noEmit",
1010
"build:nonnested": "MODE=nonnested VITE_MODE=nonnested vite build && tsc --noEmit",
11-
"serve": "vite preview",
12-
"serve:nonnested": "MODE=nonnested VITE_MODE=nonnested vite preview",
11+
"preview": "vite preview",
12+
"preview:nonnested": "MODE=nonnested VITE_MODE=nonnested vite preview",
1313
"start": "vite",
1414
"start:nonnested": "MODE=nonnested VITE_MODE=nonnested vite",
1515
"test:e2e": "pnpm run test:e2e:nonnested && pnpm run test:e2e:default",

e2e/react-router/basic-file-based/playwright.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import { useExperimentalNonNestedRoutes } from './tests/utils/useExperimentalNon
99
const PORT = await getTestServerPort(packageJson.name)
1010
const EXTERNAL_PORT = await getDummyServerPort(packageJson.name)
1111
const baseURL = `http://localhost:${PORT}`
12-
const experimentalNonNestedPathsModeCommand = `pnpm build:nonnested && pnpm serve:nonnested --port ${PORT}`
13-
const defaultCommand = `pnpm build && pnpm serve --port ${PORT}`
12+
const experimentalNonNestedPathsModeCommand = `pnpm build:nonnested && pnpm preview:nonnested --port ${PORT}`
13+
const defaultCommand = `pnpm build && pnpm preview --port ${PORT}`
1414
const command = useExperimentalNonNestedRoutes
1515
? experimentalNonNestedPathsModeCommand
1616
: defaultCommand

e2e/react-router/basic-react-query-file-based/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"dev": "vite --port 3000",
77
"dev:e2e": "vite",
88
"build": "vite build && tsc --noEmit",
9-
"serve": "vite preview",
9+
"preview": "vite preview",
1010
"start": "vite",
1111
"test:e2e": "rm -rf port*.txt; playwright test --project=chromium"
1212
},

e2e/react-router/basic-react-query-file-based/playwright.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export default defineConfig({
2525
},
2626

2727
webServer: {
28-
command: `VITE_NODE_ENV="test" VITE_SERVER_PORT=${PORT} VITE_EXTERNAL_PORT=${EXTERNAL_PORT} pnpm build && pnpm serve --port ${PORT}`,
28+
command: `VITE_NODE_ENV="test" VITE_SERVER_PORT=${PORT} VITE_EXTERNAL_PORT=${EXTERNAL_PORT} pnpm build && pnpm preview --port ${PORT}`,
2929
url: baseURL,
3030
reuseExistingServer: !process.env.CI,
3131
stdout: 'pipe',

0 commit comments

Comments
 (0)