Skip to content

Commit

Permalink
[react-interactions] Ensure props on scope query function is always o…
Browse files Browse the repository at this point in the history
…bject (#17212)
  • Loading branch information
trueadm authored Oct 29, 2019
1 parent 3497ccc commit 048879e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/react-reconciler/src/ReactFiberScope.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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));
}
}
Expand Down

0 comments on commit 048879e

Please sign in to comment.