T
TanStack3y ago
manual-pink

Getting an error with RouterProvider

I'm getting this error under <RouterProvider> and I'm not sure what's causing it. This is the error message provided:
Type '{ children: Element[]; router: Router<RouteConfig<"__root__", string, string, "", {}, AnyLoaderData, {}, {}, unknown, unknown, {}, AnySearchSchema, {}, {}, Record<never, string>, {}, (RouteConfig<...> | RouteConfig<...>)[]>, AllRouteInfo<...>, unknown>; }' is not assignable to type 'IntrinsicAttributes & RouterOptions<RouteConfig<"__root__", string, string, "", {}, AnyLoaderData, {}, {}, unknown, unknown, {}, AnySearchSchema, ... 4 more ..., (RouteConfig<...> | RouteConfig<...>)[]>, unknown> & { ...; }'.
Property 'children' does not exist on type 'IntrinsicAttributes & RouterOptions<RouteConfig<"__root__", string, string, "", {}, AnyLoaderData, {}, {}, unknown, unknown, {}, AnySearchSchema, ... 4 more ..., (RouteConfig<...> | RouteConfig<...>)[]>, unknown> & { ...; }'.ts(2322)
Type '{ children: Element[]; router: Router<RouteConfig<"__root__", string, string, "", {}, AnyLoaderData, {}, {}, unknown, unknown, {}, AnySearchSchema, {}, {}, Record<never, string>, {}, (RouteConfig<...> | RouteConfig<...>)[]>, AllRouteInfo<...>, unknown>; }' is not assignable to type 'IntrinsicAttributes & RouterOptions<RouteConfig<"__root__", string, string, "", {}, AnyLoaderData, {}, {}, unknown, unknown, {}, AnySearchSchema, ... 4 more ..., (RouteConfig<...> | RouteConfig<...>)[]>, unknown> & { ...; }'.
Property 'children' does not exist on type 'IntrinsicAttributes & RouterOptions<RouteConfig<"__root__", string, string, "", {}, AnyLoaderData, {}, {}, unknown, unknown, {}, AnySearchSchema, ... 4 more ..., (RouteConfig<...> | RouteConfig<...>)[]>, unknown> & { ...; }'.ts(2322)
No description
2 Replies
stormy-gold
stormy-gold3y ago
Router provider doesn’t accept children. Use the root createRouteConfig({ component: () => children })
manual-pink
manual-pinkOP3y ago
Thanks a bunch, I got it to work!

Did you find this page helpful?