MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / routeModule

Function routeModule

__tests__/react-router-call-tables.test.ts:52–55  ·  view source on GitHub ↗
(dir: string, name: string, file: string)

Source from the content-addressed store, hash-verified

50
51/** A route module the way Medusa writes one: a barrel that hands React Router its page as `Component`. */
52const routeModule = (dir: string, name: string, file: string): Record<string, string> => ({
53 [`${dir}/index.ts`]: `export { ${name} as Component } from './${file}';\n`,
54 [`${dir}/${file}.tsx`]: `export const ${name} = () => {\n return <div>${name}</div>;\n};\n`,
55});
56
57const MEDUSA_APP = `import { createBrowserRouter, RouteObject, RouterProvider } from 'react-router-dom';
58import { getRouteMap } from './routes/get-route.map';

Calls

no outgoing calls

Tested by

no test coverage detected