* The component a value wraps, which is what it renders: the function it * holds (`const Application = observer(function Application() {…})`), or the * component of its own file a wrapper call is handed (`const TableView = * observer(TableViewInner)`). An inner function counts when it has the val
(value: Node, context: ResolutionContext)
| 848 | * has no node for (`withFallback('X', () => { const load = () => …; … })`). |
| 849 | */ |
| 850 | function wrappedComponent(value: Node, context: ResolutionContext): Node | null { |
| 851 | const nodes = context.getNodesInFile(value.filePath); |
| 852 | const inner = nodes.filter((n) => COMPONENT_KINDS.has(n.kind) && |
| 853 | n.qualifiedName === `${value.qualifiedName}::${n.name}` && n.startLine >= value.startLine && n.endLine <= value.endLine); |
| 854 | const held = inner.find((n) => n.name === value.name) ?? |
| 855 | (inner.length === 1 && inner[0]!.endLine === value.endLine ? inner[0]! : null); |
| 856 | if (held || inner.length > 0) return held; |
| 857 | return handedComponent(value, context, nodes); |
| 858 | } |
| 859 | |
| 860 | /** |
| 861 | * The binding a value holds and nothing more — `AvatarWithHoverCard` of |
no test coverage detected