T
TanStack17mo ago
like-gold

How to type LazyRoute with code-based splitting?

I tried to implement route based code splitting following this section of the docs: https://tanstack.com/router/latest/docs/framework/react/guide/code-splitting#code-based-splitting When I implemented as shown in the example, I get following eslint error:
Unsafe return of type Promise<any> from function with return type Promise<LazyRoute<any>>.eslint@typescript-eslint/no-unsafe-return
export const dashboardRoute = createRoute({
getParentRoute: () => authRoute,
path: "/",
// component: DashboardRoute,
}).lazy(() => import('../dashboard').then((d) => d.Route));
export const dashboardRoute = createRoute({
getParentRoute: () => authRoute,
path: "/",
// component: DashboardRoute,
}).lazy(() => import('../dashboard').then((d) => d.Route));
How can I properly type this?
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?