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

Function lazyRouteComponent

src/resolution/frameworks/react.ts:487–492  ·  view source on GitHub ↗

The component a lazy route module renders: its default export, else its `Component` export.

(spec: string, fromFile: string, context: ResolutionContext, reads?: Set<string>)

Source from the content-addressed store, hash-verified

485
486/** The component a lazy route module renders: its default export, else its `Component` export. */
487function lazyRouteComponent(spec: string, fromFile: string, context: ResolutionContext, reads?: Set<string>): string | null {
488 const file = lazyModuleFile(spec, fromFile, context);
489 if (!file) return null;
490 return exportedComponent(file, 'default', context, new Set(), reads) ??
491 exportedComponent(file, 'Component', context, new Set(), reads);
492}
493
494/** The files `lazyRouteComponent` reads: the module, and the ones a barrel forwards it to. */
495function lazyRouteFiles(spec: string, fromFile: string, context: ResolutionContext): string[] {

Callers 5

resolveFunction · 0.85
lazyRouteFilesFunction · 0.85
declaredComponentFunction · 0.85
lazyValueModulesFunction · 0.85
layoutComponentFunction · 0.85

Calls 2

lazyModuleFileFunction · 0.85
exportedComponentFunction · 0.85

Tested by

no test coverage detected