Skip to content

Commit 2c8d437

Browse files
authored
Update create-browser-router.md (#11508)
1 parent eca6c0c commit 2c8d437

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

contributors.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,7 @@
258258
- xavier-lc
259259
- xcsnowcity
260260
- yionr
261+
- ChristophP
261262
- yracnet
262263
- yuleicul
263264
- zheng-chuang

docs/routers/create-browser-router.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -297,14 +297,14 @@ const routes [
297297
];
298298

299299
let router = createBrowserRouter(routes, {
300-
unstable_dataStrategy({ request, params, matches }) {
300+
async unstable_dataStrategy({ request, params, matches }) {
301301
// Run middleware sequentially and let them add data to `context`
302302
let context = {};
303-
for (match of matches) {
303+
for (const match of matches) {
304304
if (match.route.handle?.middleware) {
305305
await match.route.handle.middleware({ request, params }, context);
306306
}
307-
});
307+
}
308308

309309
// Run loaders in parallel with the `context` value
310310
return Promise.all(

0 commit comments

Comments
 (0)