Skip to content

Commit 626dc46

Browse files
committed
docs: update typegen paths
see #12284
1 parent 74e21c0 commit 626dc46

File tree

13 files changed

+23
-23
lines changed

13 files changed

+23
-23
lines changed

docs/explanation/type-safety.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export const routes: RouteConfig = [
2424
You can import route-specific types like so:
2525

2626
```tsx filename=app/routes/product.tsx
27-
import type { Route } from "./+types.product";
27+
import type { Route } from "./+types/product";
2828
// types generated for this route 👆
2929

3030
export function loader({ params }: Route.LoaderArgs) {
@@ -66,7 +66,7 @@ The following types are generated for each route:
6666
## How it works
6767

6868
React Router's type generation executes your route config (`app/routes.ts` by default) to determine the routes for your app.
69-
It then generates a `+types.<route file>.d.ts` for each route within a special `.react-router/types/` directory.
69+
It then generates a `+types/<route file>.d.ts` for each route within a special `.react-router/types/` directory.
7070
With [`rootDirs` configured][setting-up-type-safety], TypeScript can import these generated files as if they were right next to their corresponding route modules.
7171

7272
For a deeper dive into some of the design decisions, check out our [type inference decision doc](https://github.com/remix-run/react-router/blob/dev/decisions/0012-type-inference.md).

docs/how-to/file-uploads.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ import {
106106
fileStorage,
107107
getStorageKey,
108108
} from "~/avatar-storage.server";
109-
import type { Route } from "./+types.user";
109+
import type { Route } from "./+types/user";
110110

111111
export async function action({
112112
request,

docs/how-to/form-validation.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export const routes = [route("signup", "signup.tsx")];
1717
```
1818

1919
```tsx filename=signup.tsx
20-
import type { Route } from "./+types.signup";
20+
import type { Route } from "./+types/signup";
2121
import { useFetcher } from "react-router";
2222

2323
export default function Signup(_: Route.ComponentProps) {
@@ -43,7 +43,7 @@ export default function Signup(_: Route.ComponentProps) {
4343
In this step, we'll define a server `action` in the same file as our `Signup` component. Note that the aim here is to provide a broad overview of the mechanics involved rather than digging deep into form validation rules or error object structures. We'll use rudimentary checks for the email and password to demonstrate the core concepts.
4444

4545
```tsx filename=signup.tsx
46-
import type { Route } from "./+types.signup";
46+
import type { Route } from "./+types/signup";
4747
import { redirect, useFetcher, data } from "react-router";
4848

4949
export default function Signup(_: Route.ComponentProps) {

docs/how-to/headers.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ If you need to return a custom HTTP status code or custom headers from your `loa
1313

1414
```tsx filename=app/product.tsx lines=[3,6-8,14,17-21]
1515
// route("products/:pid", "./product.tsx");
16-
import type { Route } from "./+types.product";
16+
import type { Route } from "./+types/product";
1717
import { data } from "react-router";
1818
import { fakeDb } from "../db";
1919

@@ -42,7 +42,7 @@ If you need to return a custom HTTP status code or custom headers from your `act
4242

4343
```tsx filename=app/project.tsx lines=[3,11-14,19]
4444
// route('/projects/:projectId', './project.tsx')
45-
import type { Route } from "./+types.project";
45+
import type { Route } from "./+types/project";
4646
import { data } from "react-router";
4747
import { fakeDb } from "../db";
4848

docs/how-to/react-server-components.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ In the future, async components can be rendered in loaders like any other data:
1212

1313
```tsx filename=app/product-page.tsx
1414
// route("products/:pid", "./product-page.tsx");
15-
import type { Route } from "./+types.product";
15+
import type { Route } from "./+types/product";
1616
import Product from "./product";
1717
import Reviews from "./reviews";
1818

docs/how-to/resource-routes.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ route("/reports/pdf/:id", "pdf-report.ts");
1717
```
1818

1919
```tsx filename=pdf-report.ts
20-
import * as Route from "./+types.pdf-report";
20+
import * as Route from "./+types/pdf-report";
2121

2222
export async function loader({ params }: Route.LoaderArg) {
2323
const report = await getReport(params.id);
@@ -48,7 +48,7 @@ When linking to resource routes, use `<a>` or `<Link reloadDocument>`, otherwise
4848
GET requests are handled by the `loader`, while POST, PUT, PATCH, and DELETE are handled by the `action`:
4949

5050
```tsx
51-
import type { Route } from "./+types.resource";
51+
import type { Route } from "./+types/resource";
5252

5353
export function loader(_: Route.LoaderArgs) {
5454
return new Response.json({ message: "I handle GET" });

docs/how-to/suspense.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ React Router supports React Suspense by returning promises from loaders and acti
1313
React Router awaits route loaders before rendering route components. To unblock the loader for non-critical data, return the promise instead of awaiting it in the loader.
1414

1515
```tsx
16-
import * as Route from "./+types.my-route";
16+
import * as Route from "./+types/my-route";
1717

1818
export async function loader({}: Route.LoaderArg) {
1919
// note this is NOT awaited

docs/how-to/view-transitions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ The detail view needs to use the same view transition names to create a seamless
105105
```tsx filename=routes/image-details.tsx
106106
import { Link } from "react-router";
107107
import { images } from "./home";
108-
import type { Route } from "./+types.image-details";
108+
import type { Route } from "./+types/image-details";
109109

110110
export default function ImageDetailsRoute({
111111
params,

docs/how-to/webhook.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ hidden: true
99
Resource routes can be used to handle webhooks. For example, you can create a webhook that receives notifications from GitHub when a new commit is pushed to a repository:
1010

1111
```tsx
12-
import type { Route } from "./+types.github";
12+
import type { Route } from "./+types/github";
1313

1414
import crypto from "node:crypto";
1515

docs/start/framework/actions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Client actions only run in the browser and take priority over a server action wh
1515

1616
```tsx filename=app/project.tsx
1717
// route('/projects/:projectId', './project.tsx')
18-
import type { Route } from "./+types.project";
18+
import type { Route } from "./+types/project";
1919
import { Form } from "react-router";
2020
import { someApi } from "./api";
2121

@@ -52,7 +52,7 @@ Server actions only run on the server and are removed from client bundles.
5252

5353
```tsx filename=app/project.tsx
5454
// route('/projects/:projectId', './project.tsx')
55-
import type { Route } from "./+types.project";
55+
import type { Route } from "./+types/project";
5656
import { Form } from "react-router";
5757
import { fakeDb } from "../db";
5858

0 commit comments

Comments
 (0)