refactor: pre-sort all routes (#1562)

This commit is contained in:
Marvin Hagemeister
2023-08-01 13:06:35 +02:00
committed by GitHub
parent e2c9e9a2b0
commit d51ccdcf50
3 changed files with 82 additions and 166 deletions
+5 -3
View File
@@ -216,8 +216,10 @@ export async function render<Data>(
const layouts = selectLayouts(opts.url.toString(), opts.layouts);
layouts.forEach((layout) => {
const curComp = { ...finalAppComp };
let i = layouts.length;
while (i--) {
const layout = layouts[i];
const curComp = finalAppComp;
finalAppComp = h(layout.default, {
params: opts.params as Record<string, string>,
@@ -229,7 +231,7 @@ export async function render<Data>(
return curComp;
},
});
});
}
const root = h(CSP_CONTEXT.Provider, {
value: csp,