Skip to content

Commit 9d42655

Browse files
committed
chore: format
1 parent ef67804 commit 9d42655

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

docs/routers/create-browser-router.md

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,9 @@ const routes = [
275275
{
276276
id: "parent",
277277
path: "/parent",
278-
loader({ request }, context) { /*...*/ },
278+
loader({ request }, context) {
279+
/*...*/
280+
},
279281
handle: {
280282
async middleware({ request }, context) {
281283
context.parent = "PARENT MIDDLEWARE";
@@ -285,7 +287,9 @@ const routes = [
285287
{
286288
id: "child",
287289
path: "child",
288-
loader({ request }, context) { /*...*/ },
290+
loader({ request }, context) {
291+
/*...*/
292+
},
289293
handle: {
290294
async middleware({ request }, context) {
291295
context.child = "CHILD MIDDLEWARE";
@@ -297,12 +301,19 @@ const routes = [
297301
];
298302

299303
let router = createBrowserRouter(routes, {
300-
async unstable_dataStrategy({ request, params, matches }) {
304+
async unstable_dataStrategy({
305+
request,
306+
params,
307+
matches,
308+
}) {
301309
// Run middleware sequentially and let them add data to `context`
302310
let context = {};
303311
for (const match of matches) {
304312
if (match.route.handle?.middleware) {
305-
await match.route.handle.middleware({ request, params }, context);
313+
await match.route.handle.middleware(
314+
{ request, params },
315+
context
316+
);
306317
}
307318
}
308319

0 commit comments

Comments
 (0)