Skip to content
Source
Sign inSign up
TanStack/router

Quick start fails with `Property 'children' does not exist on type` #425

Send to my agent
Closedscarf005(GitHub profile, opens in a new tab) opened this issue 1 comment

Describe the bug

RouterProvider complains that it does not have property 'children', which makes even the example quick start unable to run.

Your Example Website or App

https://stackblitz.com/edit/vitejs-vite-ff88yw?file=src/App.tsx

Steps to Reproduce the Bug or Issue

  1. install latest package version (^0.0.1-beta.32)
  2. copy and paste example code from documentation

Expected behavior

there should not be an type error.

Screenshots or Videos

image

Platform

  • OS: Linux
  • Browser: Firefox
  • Version: 108.0b9

Additional context

error log:

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> & { ...; }'.(2322)
  1. RouterProvider doesn't accept children as Root Outlet as of 0.0.1-beta.30, I believe.

    You you pass your "Root" component as component prop to createRouteConfig like

    const rootRoute = createRouteConfig({
      component: () => (
        <>
          <Outlet />
          <TanStackRouterDevtools />
        </>
      )
    })
  2. tannerlinsley closed this

Sign in to join this conversation.