mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
[react-interactions] Ensure props on scope query function is always object (#17212)
This commit is contained in:
+3
-1
@@ -31,6 +31,8 @@ function getSuspenseFallbackChild(fiber: Fiber): Fiber | null {
|
||||
return ((((fiber.child: any): Fiber).sibling: any): Fiber).child;
|
||||
}
|
||||
|
||||
const emptyObject = {};
|
||||
|
||||
function collectScopedNodes(
|
||||
node: Fiber,
|
||||
fn: (type: string | Object, props: Object) => boolean,
|
||||
@@ -39,7 +41,7 @@ function collectScopedNodes(
|
||||
if (enableScopeAPI) {
|
||||
if (node.tag === HostComponent) {
|
||||
const {type, memoizedProps} = node;
|
||||
if (fn(type, memoizedProps) === true) {
|
||||
if (fn(type, memoizedProps || emptyObject) === true) {
|
||||
scopedNodes.push(getPublicInstance(node.stateNode));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user