({
children,
history,
config,
outletContext,
}: {
children: React.ReactNode;
config: RouterConfig | undefined;
history: MemoryHistory;
outletContext: Record<string, unknown> | undefined;
})
| 197 | } |
| 198 | |
| 199 | function makeRouter({ |
| 200 | children, |
| 201 | history, |
| 202 | config, |
| 203 | outletContext, |
| 204 | }: { |
| 205 | children: React.ReactNode; |
| 206 | config: RouterConfig | undefined; |
| 207 | history: MemoryHistory; |
| 208 | outletContext: Record<string, unknown> | undefined; |
| 209 | }) { |
| 210 | const childRoutes = createRoutesFromConfig(children, config); |
| 211 | const routes = outletContext |
| 212 | ? [ |
| 213 | { |
| 214 | path: '/', |
| 215 | element: <Outlet context={outletContext} />, |
| 216 | children: childRoutes, |
| 217 | }, |
| 218 | ] |
| 219 | : childRoutes; |
| 220 | |
| 221 | const router = createRouter({ |
| 222 | future: { |
| 223 | v7_prependBasename: true, |
| 224 | v7_relativeSplatPath: true, |
| 225 | }, |
| 226 | history, |
| 227 | routes, |
| 228 | }).initialize(); |
| 229 | |
| 230 | return router; |
| 231 | } |
| 232 | |
| 233 | class TestRouter { |
| 234 | private router: Router; |
no test coverage detected