MCPcopy Create free account
hub / github.com/solidjs/solid-start / createRoutes

Function createRoutes

packages/start/src/router.tsx:9–27  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

7const components: Record<string, Component> = {};
8
9export function createRoutes() {
10 function createRoute(route: any) {
11 const component =
12 route.$component && (components[route.$component.src] ??= lazy(route.$component.import));
13
14 return {
15 ...route,
16 ...(route.$$route ? route.$$route.require().route : undefined),
17 info: {
18 ...(route.$$route ? route.$$route.require().route.info : {}),
19 filesystem: true,
20 },
21 component,
22 children: route.children ? route.children.map(createRoute) : undefined,
23 };
24 }
25 const routes = routeConfigs.map(createRoute);
26 return routes;
27}
28
29let routes: any[];
30

Callers 2

createPageEventFunction · 0.90
router.tsxFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…