MCPcopy
hub / github.com/getsentry/sentry / makeRouter

Function makeRouter

tests/js/sentry-test/reactTestingLibrary.tsx:199–231  ·  view source on GitHub ↗
({
  children,
  history,
  config,
  outletContext,
}: {
  children: React.ReactNode;
  config: RouterConfig | undefined;
  history: MemoryHistory;
  outletContext: Record<string, unknown> | undefined;
})

Source from the content-addressed store, hash-verified

197}
198
199function 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
233class TestRouter {
234 private router: Router;

Callers 3

renderFunction · 0.85
rerenderFunction · 0.85
WrapperFunction · 0.85

Calls 2

createRoutesFromConfigFunction · 0.85
initializeMethod · 0.45

Tested by

no test coverage detected