[react-interactions] Ensure props on scope query function is always object (#17212)
Dominic Gannaway committed
Oct 29, 2019 at 13:26 UTC
048879edadfc43de699765688e9ebfcdf4a681b7
1 file changed
+3
-1
packages/react-reconciler/src/ReactFiberScope.js
+3
-1
@@ -31,6 +31,8 @@ function getSuspenseFallbackChild(fiber: Fiber): Fiber | null {
31
return ((((fiber.child: any): Fiber).sibling: any): Fiber).child;
32
}
33
34
+const emptyObject = {};
35
+
36
function collectScopedNodes(
37
node: Fiber,
38
fn: (type: string | Object, props: Object) => boolean,
@@ -39,7 +41,7 @@ function collectScopedNodes(
41
if (enableScopeAPI) {
42
if (node.tag === HostComponent) {
43
const {type, memoizedProps} = node;
42
- if (fn(type, memoizedProps) === true) {
44
+ if (fn(type, memoizedProps || emptyObject) === true) {
45
scopedNodes.push(getPublicInstance(node.stateNode));
46
}
47
}