Skip to content

Commit 048879e

Browse files
authored
[react-interactions] Ensure props on scope query function is always object (#17212)
1 parent 3497ccc commit 048879e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/react-reconciler/src/ReactFiberScope.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ function getSuspenseFallbackChild(fiber: Fiber): Fiber | null {
3131
return ((((fiber.child: any): Fiber).sibling: any): Fiber).child;
3232
}
3333

34+
const emptyObject = {};
35+
3436
function collectScopedNodes(
3537
node: Fiber,
3638
fn: (type: string | Object, props: Object) => boolean,
@@ -39,7 +41,7 @@ function collectScopedNodes(
3941
if (enableScopeAPI) {
4042
if (node.tag === HostComponent) {
4143
const {type, memoizedProps} = node;
42-
if (fn(type, memoizedProps) === true) {
44+
if (fn(type, memoizedProps || emptyObject) === true) {
4345
scopedNodes.push(getPublicInstance(node.stateNode));
4446
}
4547
}

0 commit comments

Comments
 (0)