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

Function isReactRouteRef

src/resolution/frameworks/react.ts:514–516  ·  view source on GitHub ↗

* True for a reference a React route makes: from a `route: :…` node, in * tsx or jsx, the language React gives its routes even in a `.ts` routes * file. Vue Router's and Angular's routes are never in either.

(ref: UnresolvedRef)

Source from the content-addressed store, hash-verified

512 * file. Vue Router's and Angular's routes are never in either.
513 */
514function isReactRouteRef(ref: UnresolvedRef): boolean {
515 return (ref.language === 'tsx' || ref.language === 'jsx') && ref.fromNodeId.startsWith(`route:${ref.filePath}:`);
516}
517
518/** What a module can export as a component: a declaration, or a value holding one. */
519const EXPORTED_COMPONENT_KINDS = new Set(['function', 'component', 'class', 'constant', 'variable']);

Callers 3

resolveFunction · 0.85
lazyModulesFunction · 0.85
layoutComponentFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected