MCPcopy
hub / github.com/TanStack/router / Header

Function Header

packages/solid-router/tests/loaders.test.tsx:488–508  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

486 })
487
488 function Header() {
489 const router = useRouter()
490 const ctx = appRoute.useRouteContext()
491
492 return (
493 <div>
494 Header Counter: <p data-testid="header-counter">{ctx().counter}</p>
495 <button
496 onClick={() => {
497 router.invalidate()
498 }}
499 data-testid="invalidate-router"
500 style={{
501 border: '1px solid blue',
502 }}
503 >
504 Invalidate router
505 </button>
506 </div>
507 )
508 }
509
510 const indexRoute = createRoute({
511 getParentRoute: () => appRoute,

Callers

nothing calls this directly

Calls 2

useRouterFunction · 0.90
invalidateMethod · 0.45

Tested by

no test coverage detected