Skip to content

Commit 8174d54

Browse files
author
Brian Vaughn
committed
Pass owner to createFiber fn when creating a memo component.
1 parent fac6a69 commit 8174d54

4 files changed

Lines changed: 10 additions & 8 deletions

File tree

packages/react-reconciler/src/ReactFiber.new.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -579,6 +579,10 @@ export function createFiberFromTypeAndProps(
579579
fiber.type = resolvedType;
580580
fiber.lanes = lanes;
581581

582+
if (__DEV__) {
583+
fiber._debugOwner = owner;
584+
}
585+
582586
return fiber;
583587
}
584588

packages/react-reconciler/src/ReactFiber.old.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -573,6 +573,10 @@ export function createFiberFromTypeAndProps(
573573
fiber.type = resolvedType;
574574
fiber.lanes = lanes;
575575

576+
if (__DEV__) {
577+
fiber._debugOwner = owner;
578+
}
579+
576580
return fiber;
577581
}
578582

packages/react-reconciler/src/ReactFiberBeginWork.new.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -434,16 +434,13 @@ function updateMemoComponent(
434434
Component.type,
435435
null,
436436
nextProps,
437-
null,
437+
workInProgress,
438438
workInProgress.mode,
439439
renderLanes,
440440
);
441441
child.ref = workInProgress.ref;
442442
child.return = workInProgress;
443443
workInProgress.child = child;
444-
if (__DEV__) {
445-
child._debugOwner = workInProgress;
446-
}
447444
return child;
448445
}
449446
if (__DEV__) {

packages/react-reconciler/src/ReactFiberBeginWork.old.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -434,16 +434,13 @@ function updateMemoComponent(
434434
Component.type,
435435
null,
436436
nextProps,
437-
null,
437+
workInProgress,
438438
workInProgress.mode,
439439
renderLanes,
440440
);
441441
child.ref = workInProgress.ref;
442442
child.return = workInProgress;
443443
workInProgress.child = child;
444-
if (__DEV__) {
445-
child._debugOwner = workInProgress;
446-
}
447444
return child;
448445
}
449446
if (__DEV__) {

0 commit comments

Comments
 (0)