* React Router 7's object of lazy properties, `lazy: { loader: …, Component: * async () => (await import('./x')).Page }`: each loads on its own, and the * `Component`'s loader resolves to the page itself.
(code: string)
| 1602 | * `Component`'s loader resolves to the page itself. |
| 1603 | */ |
| 1604 | function lazyPropertiesRender(code: string): string | null | undefined { |
| 1605 | if (matchBracket(code, 0) !== code.length - 1) return undefined; |
| 1606 | const component = objectEntries(code.slice(1, -1)).props.get('Component'); |
| 1607 | if (component === undefined) return null; |
| 1608 | const page = pageReference(loaderValue(component, new Map())); |
| 1609 | if (page) return page; |
| 1610 | const spec = FIRST_IMPORT.exec(component)?.[1]; |
| 1611 | return spec ? LAZY_ROUTE_PREFIX + spec : undefined; |
| 1612 | } |
| 1613 | |
| 1614 | /** The distinct exports `text` uses through the names a loader bound them to: `Page`, `m.Page`. */ |
| 1615 | function loadedExports(text: string, scope: LoaderScope): Loaded[] { |
no test coverage detected