Skip to content

Commit ec5c019

Browse files
committed
Fix JSDoc types for context
1 parent c47c648 commit ec5c019

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

.changeset/lovely-cups-sniff.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"react-router": patch
3+
---
4+
5+
Fix jsdoc types for `context`

packages/react-router/lib/types/route-module.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,11 @@ type ClientDataFunctionArgs<T extends RouteInfo> = {
143143
params: T["params"];
144144
/**
145145
* When `future.unstable_middleware` is not enabled, this is undefined.
146+
*
146147
* When `future.unstable_middleware` is enabled, this is an instance of
147-
* `{@link unstable_RouterContextProvider}` and can be used to access context values
148+
* `unstable_RouterContextProvider` and can be used to access context values
148149
* from your route middlewares. You may pass in initial context values in your
149-
* `{@link unstable_getContext}` function passed tp `{@link HydratedRouter}`
150+
* `<HydratedRouter unstable_getContext>` prop
150151
*/
151152
context: unstable_RouterContextProvider;
152153
};
@@ -171,15 +172,15 @@ type ServerDataFunctionArgs<T extends RouteInfo> = {
171172
params: T["params"];
172173
/**
173174
* Without `future.unstable_middleware` enabled, this is the context passed in
174-
* to your server adapter's `{@link getLoadContext}` function. It's a way to bridge the
175+
* to your server adapter's `getLoadContext` function. It's a way to bridge the
175176
* gap between the adapter's request/response API with your React Router app.
176177
* It is only applicable if you are using a custom server adapter.
177178
*
178179
* With `future.unstable_middleware` enabled, this is an instance of
179-
* `{@link unstable_RouterContextProvider}` and can be used for type-safe access to
180+
* `unstable_RouterContextProvider` and can be used for type-safe access to
180181
* context value set in your route middlewares. If you are using a custom
181182
* server adapter, you may provide an initial set of context values from your
182-
* `{@link getLoadContext}` function.
183+
* `getLoadContext` function.
183184
*/
184185
context: MiddlewareEnabled extends true
185186
? unstable_RouterContextProvider

0 commit comments

Comments
 (0)