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.


2 Replies
probable-pink•2y ago
please create a minimal complete example on codesandbox
fair-roseOP•2y ago
Actually I don't think the problem is related to library. I don't know TypeScript so much so I need help on it. There is really a small amount of code here. I guess a person using TS would detect the problem in a minute.
I was using typescirpt@4. Problem is fixed when i update it to version 5.