Skip to content

Commit 4e984ff

Browse files
committed
Avoid reassigning props warning when we bailout
1 parent 26c716f commit 4e984ff

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

packages/react-reconciler/src/ReactFiberBeginWork.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -856,7 +856,7 @@ function updateClassComponent(
856856
);
857857
if (__DEV__) {
858858
const inst = workInProgress.stateNode;
859-
if (inst.props !== nextProps) {
859+
if (shouldUpdate && inst.props !== nextProps) {
860860
if (!didWarnAboutReassigningProps) {
861861
console.error(
862862
'It looks like %s is reassigning its own `this.props` while rendering. ' +

packages/react-reconciler/src/ReactFiberClassComponent.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1075,7 +1075,6 @@ function updateClassInstance(
10751075
workInProgress.effectTag |= Snapshot;
10761076
}
10771077
}
1078-
instance.props = workInProgress.memoizedProps = newProps;
10791078
return false;
10801079
}
10811080

0 commit comments

Comments
 (0)