()
| 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, |
nothing calls this directly
no test coverage detected