Skip to content

Commit 3acd610

Browse files
authored
docs(api): Fix doc examples that are missing async (#14017)
1 parent 82b735e commit 3acd610

File tree

4 files changed

+4
-3
lines changed

4 files changed

+4
-3
lines changed

contributors.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,7 @@
268268
- namoscato
269269
- ned-park
270270
- nenene3
271+
- ngbrown
271272
- nichtsam
272273
- nikeee
273274
- nilubisan

docs/how-to/headers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ You can avoid the need to merge headers by only defining headers in "leaf routes
113113
The `handleRequest` export receives the headers from the route module as an argument. You can append global headers here.
114114

115115
```tsx
116-
export default function handleRequest(
116+
export default async function handleRequest(
117117
request,
118118
responseStatusCode,
119119
responseHeaders,

packages/react-router/lib/components.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1269,7 +1269,7 @@ export interface AwaitProps<Resolve> {
12691269
* @example
12701270
* import { Await, useLoaderData } from "react-router";
12711271
*
1272-
* export function loader() {
1272+
* export async function loader() {
12731273
* // not awaited
12741274
* const reviews = getReviews();
12751275
* // awaited (blocks the transition)

packages/react-router/lib/dom/lib.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ export interface DOMRouterOpts {
373373
* ];
374374
*
375375
* let router = createBrowserRouter(routes, {
376-
* dataStrategy({ request, params, matches }) {
376+
* async dataStrategy({ request, params, matches }) {
377377
* // Compose route fragments into a single GQL payload
378378
* let gql = getFragmentsFromRouteHandles(matches);
379379
* let data = await fetchGql(gql);

0 commit comments

Comments
 (0)