( node: Fiber, fn: ReactScopeQuery, scopedNodes: Array<any>, )
| 31 | const emptyObject = {}; |
| 32 | |
| 33 | function collectScopedNodes( |
| 34 | node: Fiber, |
| 35 | fn: ReactScopeQuery, |
| 36 | scopedNodes: Array<any>, |
| 37 | ): void { |
| 38 | if (enableScopeAPI) { |
| 39 | if (node.tag === HostComponent) { |
| 40 | const {type, memoizedProps, stateNode} = node; |
| 41 | const instance = getPublicInstance(stateNode); |
| 42 | if ( |
| 43 | instance !== null && |
| 44 | fn(type, memoizedProps || emptyObject, instance) === true |
| 45 | ) { |
| 46 | scopedNodes.push(instance); |
| 47 | } |
| 48 | } |
| 49 | let child = node.child; |
| 50 | |
| 51 | if (isFiberSuspenseAndTimedOut(node)) { |
| 52 | child = getSuspenseFallbackChild(node); |
| 53 | } |
| 54 | if (child !== null) { |
| 55 | collectScopedNodesFromChildren(child, fn, scopedNodes); |
| 56 | } |
| 57 | } |
| 58 | } |
| 59 | |
| 60 | function collectFirstScopedNode( |
| 61 | node: Fiber, |
no test coverage detected