We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2f64c72 commit d370467Copy full SHA for d370467
packages/tanstack-react-router/src/generate.ts
@@ -70,11 +70,12 @@ const generateRoutes = async () => {
70
71
const components = [meta._component, meta._pendingComponent, meta._errorComponent].filter(Boolean)
72
const options = [path ? `path: '${path}'` : `id: '${id}'`, meta._loader, meta._action].filter(Boolean)
73
+ const module = `const ${id} = createRoute({ getParentRoute: () => ${pid}, ${options.join(', ')} })`
74
75
modules.push(
- `const ${id} = createRoute({ getParentRoute: () => ${pid}, ${options.join(', ')} }).lazy(() =>
76
+ meta._module ? `${module}.lazy(() =>
77
${meta._module}.then((m) => createLazyRoute('${meta._path}')({ ${components.join(', ')} }))
- )`,
78
+ )` : module,
79
)
80
}
81
0 commit comments