()
| 67 | } |
| 68 | |
| 69 | function 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 | |
| 117 | export type UseMatchRouteOptions< |
| 118 | TRouter extends AnyRouter = RegisteredRouter, |
nothing calls this directly
no test coverage detected