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
Copy file name to clipboardExpand all lines: docs/how-to/middleware.md
+2-16Lines changed: 2 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,21 +41,7 @@ export default {
41
41
42
42
<docs-warning>By enabling the middleware feature, you change the type of the `context` parameter to your loaders and actions. Please pay attention to the section on [getLoadContext](#custom-server-with-getloadcontext) below if you are actively using `context` today.</docs-warning>
43
43
44
-
### 2. Add type support
45
-
46
-
Update your `app/types/global.d.ts` to enable middleware types:
47
-
48
-
```ts filename=app/types/global.d.ts
49
-
declaremodule"@react-router/dev/routes" {
50
-
interfaceAppConfig {
51
-
future: {
52
-
unstable_middleware:true;
53
-
};
54
-
}
55
-
}
56
-
```
57
-
58
-
### 3. Create a context
44
+
### 2. Create a context
59
45
60
46
Create type-safe context objects using `unstable_createContext`:
0 commit comments