TanStackT
TanStack3y ago
3 replies
sad-indigo

Type '{ children: never[]; router: Router<Route<any, "/", "/", string, "__root__", {}, {}, {}, {},

This is my first day with TS and i'm trying to migrate my codebase from JS to TS.

I'm getting this error:

TS2322: Type '{ children: never[]; router: Router<Route<any, "/", "/", string, "root", {}, {}, {}, {}, {}, {}, {}, RouteContext, {}, {}, {}, unknown, (Route<RootRoute<{}, {}, {}, RouteContext, {}, {}, unknown>, ... 17 more ..., AnyRoute> | Route<...>)[], any>, Record<...>>; }' is not assignable to type 'IntrinsicAttributes & Omit<RouterOptions<Route<any, "/", "/", string, "root", {}, {}, {}, {}, {}, {}, {}, RouteContext, {}, {}, {}, unknown, (Route<RootRoute<{}, ... 5 more ..., unknown>, ... 17 more ..., AnyRoute> | Route<...>)[], any>, Record<...>>, "context"> & { ...; }'.
Property 'children' does not exist on type 'IntrinsicAttributes & Omit<RouterOptions<Route<any, "/", "/", string, "root", {}, {}, {}, {}, {}, {}, {}, RouteContext, {}, {}, {}, unknown, (Route<RootRoute<{}, ... 5 more ..., unknown>, ... 17 more ..., AnyRoute> | Route<...>)[], any>, Record<...>>, "context"> & { ...; }'.

I added App.tsx and routeTree.gen.tsx as imaged due to charachter limitations.
Screenshot_2024-01-04_at_20.34.08.png
Screenshot_2024-01-04_at_20.35.47.png
Was this page helpful?