Skip to content

Commit 23f9f4e

Browse files
committed
Add note on getLoadContext to changeset
1 parent 23ff92a commit 23f9f4e

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

.changeset/middleware.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,3 +163,15 @@ export function loader({ context }: Route.LoaderArgs) {
163163
return { profile };
164164
}
165165
```
166+
167+
If you are using a custom server with a `getLoadContext` function, the return value for initial context values passed from the server adapter layere is no longer an object and should now be a `Map<RouterContext, unknown>`:
168+
169+
```ts
170+
let adapterContext = unstable_createContext<MyAdapterContext>();
171+
172+
function getLoadContext(req, res) {
173+
let map = new Map();
174+
map.set(adapterContext, getAdapterContext(req));
175+
return map;
176+
}
177+
```

0 commit comments

Comments
 (0)