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

Function MatchesInner

packages/solid-router/src/Matches.tsx:69–115  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

67}
68
69function MatchesInner() {
70 const router = useRouter()
71 const matchId = useRouterState({
72 select: (s) => {
73 return s.matches[0]?.id
74 },
75 })
76
77 const resetKey = useRouterState({
78 select: (s) => s.loadedAt,
79 })
80
81 const matchComponent = () => {
82 return (
83 <Solid.Show when={matchId()}>
84 <Match matchId={matchId()!} />
85 </Solid.Show>
86 )
87 }
88
89 return (
90 <matchContext.Provider value={matchId}>
91 {router.options.disableGlobalCatchBoundary ? (
92 matchComponent()
93 ) : (
94 <CatchBoundary
95 getResetKey={() => resetKey()}
96 errorComponent={ErrorComponent}
97 onCatch={
98 process.env.NODE_ENV !== 'production'
99 ? (error) => {
100 warning(
101 false,
102 `The following error wasn't caught by any route! At the very leas
103 t, consider setting an 'errorComponent' in your RootRoute!`,
104 )
105 warning(false, error.message || error.toString())
106 }
107 : undefined
108 }
109 >
110 {matchComponent()}
111 </CatchBoundary>
112 )}
113 </matchContext.Provider>
114 )
115}
116
117export type UseMatchRouteOptions<
118 TRouter extends AnyRouter = RegisteredRouter,

Callers

nothing calls this directly

Calls 4

useRouterFunction · 0.90
useRouterStateFunction · 0.90
matchComponentFunction · 0.85
toStringMethod · 0.65

Tested by

no test coverage detected