Skip to content

Commit 4fec1d5

Browse files
committed
chore: generate markdown docs from jsdocs
1 parent 426e5ca commit 4fec1d5

File tree

8 files changed

+35
-53
lines changed

8 files changed

+35
-53
lines changed

docs/api/data-routers/createBrowserRouter.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -235,25 +235,25 @@ let router = createBrowserRouter(routes, {
235235

236236
Future flags to enable for the router.
237237

238-
### opts.unstable_getContext
238+
### opts.getContext
239239

240-
A function that returns an [`unstable_RouterContextProvider`](../utils/RouterContextProvider) instance
240+
A function that returns an [`RouterContextProvider`](../utils/RouterContextProvider) instance
241241
which is provided as the `context` argument to client [`action`](../../start/data/route-object#action)s,
242242
[`loader`](../../start/data/route-object#loader)s and [middleware](../../how-to/middleware).
243243
This function is called to generate a fresh `context` instance on each
244244
navigation or fetcher call.
245245

246246
```tsx
247247
import {
248-
unstable_createContext,
249-
unstable_RouterContextProvider,
248+
createContext,
249+
RouterContextProvider,
250250
} from "react-router";
251251

252-
const apiClientContext = unstable_createContext<APIClient>();
252+
const apiClientContext = createContext<APIClient>();
253253

254254
function createBrowserRouter(routes, {
255-
unstable_getContext() {
256-
let context = new unstable_RouterContextProvider();
255+
getContext() {
256+
let context = new RouterContextProvider();
257257
context.set(apiClientContext, getApiClient());
258258
return context;
259259
}

docs/api/data-routers/createHashRouter.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,25 +48,25 @@ Basename path for the application.
4848

4949
Future flags to enable for the router.
5050

51-
### opts.unstable_getContext
51+
### opts.getContext
5252

53-
A function that returns an [`unstable_RouterContextProvider`](../utils/RouterContextProvider) instance
53+
A function that returns an [`RouterContextProvider`](../utils/RouterContextProvider) instance
5454
which is provided as the `context` argument to client [`action`](../../start/data/route-object#action)s,
5555
[`loader`](../../start/data/route-object#loader)s and [middleware](../../how-to/middleware).
5656
This function is called to generate a fresh `context` instance on each
5757
navigation or fetcher call.
5858

5959
```tsx
6060
import {
61-
unstable_createContext,
62-
unstable_RouterContextProvider,
61+
createContext,
62+
RouterContextProvider,
6363
} from "react-router";
6464
65-
const apiClientContext = unstable_createContext<APIClient>();
65+
const apiClientContext = createContext<APIClient>();
6666
6767
function createBrowserRouter(routes, {
68-
unstable_getContext() {
69-
let context = new unstable_RouterContextProvider();
68+
getContext() {
69+
let context = new RouterContextProvider();
7070
context.set(apiClientContext, getApiClient());
7171
return context;
7272
}

docs/api/data-routers/createMemoryRouter.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ Only intended for advanced usage.
5454

5555
Future flags to enable for the router.
5656

57-
### opts.unstable_getContext
57+
### opts.getContext
5858

59-
A function that returns an [`unstable_RouterContextProvider`](../utils/RouterContextProvider) instance
59+
A function that returns an [`RouterContextProvider`](../utils/RouterContextProvider) instance
6060
which is provided as the `context` argument to client [`action`](../../start/data/route-object#action)s,
6161
[`loader`](../../start/data/route-object#loader)s and [middleware](../../how-to/middleware).
6262
This function is called to generate a fresh `context` instance on each

docs/api/framework-routers/HydratedRouter.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function HydratedRouter(props: HydratedRouterProps)
3131

3232
## Props
3333

34-
### unstable_getContext
34+
### getContext
3535

3636
Context object to be passed through to [`createBrowserRouter`](../data-routers/createBrowserRouter) and made
3737
available to

docs/api/rsc/RSCHydratedRouter.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ function RSCHydratedRouter({
6565
fetch: fetchImplementation = fetch,
6666
payload,
6767
routeDiscovery = "eager",
68-
unstable_getContext,
68+
getContext,
6969
}: RSCHydratedRouterProps)
7070
```
7171

@@ -80,9 +80,9 @@ used to decode payloads from the server.
8080

8181
Optional fetch implementation. Defaults to global [`fetch`](https://developer.mozilla.org/en-US/docs/Web/API/fetch).
8282

83-
### unstable_getContext
83+
### getContext
8484

85-
A function that returns an [`unstable_RouterContextProvider`](../utils/RouterContextProvider) instance
85+
A function that returns an [`RouterContextProvider`](../utils/RouterContextProvider) instance
8686
which is provided as the `context` argument to client [`action`](../../start/data/route-object#action)s,
8787
[`loader`](../../start/data/route-object#loader)s and [middleware](../../how-to/middleware).
8888
This function is called to generate a fresh `context` instance on each

docs/api/rsc/matchRSCServerRequest.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ async function matchRSCServerRequest({
8787
decodeReply?: DecodeReplyFunction;
8888
decodeAction?: DecodeActionFunction;
8989
decodeFormState?: DecodeFormStateFunction;
90-
requestContext?: unstable_RouterContextProvider;
90+
requestContext?: RouterContextProvider;
9191
loadServerAction?: LoadServerActionFunction;
9292
onError?: (error: unknown) => void;
9393
request: Request;
@@ -147,7 +147,7 @@ The [`Request`](https://developer.mozilla.org/en-US/docs/Web/API/Request) to mat
147147

148148
### opts.requestContext
149149

150-
An instance of [`unstable_RouterContextProvider`](../utils/RouterContextProvider) that should be created per request, to be passed to [`action`](../../start/data/route-object#action)s,
150+
An instance of [`RouterContextProvider`](../utils/RouterContextProvider) that should be created per request, to be passed to [`action`](../../start/data/route-object#action)s,
151151
[`loader`](../../start/data/route-object#loader)s and [middleware](../../how-to/middleware).
152152

153153
### opts.routes

docs/api/utils/RouterContextProvider.md

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
---
22
title: RouterContextProvider
3-
unstable: true
43
---
54

6-
# unstable_RouterContextProvider
5+
# RouterContextProvider
76

87
<!--
98
⚠️ ⚠️ IMPORTANT ⚠️ ⚠️
@@ -19,28 +18,21 @@ https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/ro
1918

2019
[MODES: framework, data]
2120

22-
<br />
23-
<br />
24-
25-
<docs-warning>This API is experimental and subject to breaking changes in
26-
minor/patch releases. Please use with caution and pay **very** close attention
27-
to release notes for relevant changes.</docs-warning>
28-
2921
## Summary
3022

31-
[Reference Documentation ↗](https://api.reactrouter.com/v7/classes/react_router.unstable_RouterContextProvider.html)
23+
[Reference Documentation ↗](https://api.reactrouter.com/v7/classes/react_router.RouterContextProvider.html)
3224

3325
Provides methods for writing/reading values in application context in a
3426
type-safe way. Primarily for usage with [middleware](../../how-to/middleware).
3527

3628
```tsx
3729
import {
38-
unstable_createContext,
39-
unstable_RouterContextProvider
30+
createContext,
31+
RouterContextProvider
4032
} from "react-router";
4133

42-
const userContext = unstable_createContext<User | null>(null);
43-
const contextProvider = new unstable_RouterContextProvider();
34+
const userContext = createContext<User | null>(null);
35+
const contextProvider = new RouterContextProvider();
4436
contextProvider.set(userContext, getUser());
4537
// ^ Type-safe
4638
const user = contextProvider.get(userContext);

docs/api/utils/createContext.md

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
---
22
title: createContext
3-
unstable: true
43
---
54

6-
# unstable_createContext
5+
# createContext
76

87
<!--
98
⚠️ ⚠️ IMPORTANT ⚠️ ⚠️
@@ -19,18 +18,11 @@ https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/ro
1918

2019
[MODES: framework, data]
2120

22-
<br />
23-
<br />
24-
25-
<docs-warning>This API is experimental and subject to breaking changes in
26-
minor/patch releases. Please use with caution and pay **very** close attention
27-
to release notes for relevant changes.</docs-warning>
28-
2921
## Summary
3022

31-
[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react_router.unstable_createContext.html)
23+
[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react_router.createContext.html)
3224

33-
Creates a type-safe [`unstable_RouterContext`](https://api.reactrouter.com/v7/interfaces/react_router.unstable_RouterContext.html) object that can be used to
25+
Creates a type-safe [`RouterContext`](https://api.reactrouter.com/v7/interfaces/react_router.RouterContext.html) object that can be used to
3426
store and retrieve arbitrary values in [`action`](../../start/framework/route-module#action)s,
3527
[`loader`](../../start/framework/route-module#loader)s, and [middleware](../../how-to/middleware).
3628
Similar to React's [`createContext`](https://react.dev/reference/react/createContext),
@@ -41,11 +33,11 @@ when no value has been set for the context. Otherwise, reading this context
4133
when no value has been set will throw an error.
4234

4335
```tsx filename=app/context.ts
44-
import { unstable_createContext } from "react-router";
36+
import { createContext } from "react-router";
4537

4638
// Create a context for user data
4739
export const userContext =
48-
unstable_createContext<User | null>(null);
40+
createContext<User | null>(null);
4941
```
5042

5143
```tsx filename=app/middleware/auth.ts
@@ -80,9 +72,7 @@ export async function loader({
8072
## Signature
8173

8274
```tsx
83-
function unstable_createContext<T>(
84-
defaultValue?: T,
85-
): unstable_RouterContext<T>
75+
function createContext<T>(defaultValue?: T): RouterContext<T>
8676
```
8777

8878
## Params
@@ -93,7 +83,7 @@ An optional default value for the context. This value will be returned if no val
9383

9484
## Returns
9585

96-
A [`unstable_RouterContext`](https://api.reactrouter.com/v7/interfaces/react_router.unstable_RouterContext.html) object that can be used with
86+
A [`RouterContext`](https://api.reactrouter.com/v7/interfaces/react_router.RouterContext.html) object that can be used with
9787
`context.get()` and `context.set()` in [`action`](../../start/framework/route-module#action)s,
9888
[`loader`](../../start/framework/route-module#loader)s, and [middleware](../../how-to/middleware).
9989

0 commit comments

Comments
 (0)