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

Function lazyRouteComponent

src/resolution/frameworks/react.ts:486–491  ·  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

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