MCPcopy Index your code
hub / github.com/TanStack/router / RootComponent

Function RootComponent

packages/solid-router/tests/useCanGoBack.test.tsx:26–41  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

24 initialEntries?: Array<string>
25 } = {}) {
26 function RootComponent() {
27 const router = useRouter()
28 const location = useLocation()
29 const canGoBack = useCanGoBack()
30
31 expect(canGoBack()).toBe(location().pathname === '/' ? false : true)
32
33 return (
34 <>
35 <button onClick={() => router.history.back()}>Back</button>
36 <Link to="/">Home</Link>
37 <Link to="/about">About</Link>
38 <Outlet />
39 </>
40 )
41 }
42
43 const rootRoute = createRootRoute({
44 component: RootComponent,

Callers

nothing calls this directly

Calls 4

useRouterFunction · 0.90
useLocationFunction · 0.90
useCanGoBackFunction · 0.90
locationFunction · 0.50

Tested by

no test coverage detected