Remove unnecessary check (#24332)
zhoulixiang committed
Apr 12, 2022 at 03:08 UTC
01e2bff1dcd99fffc9b1ea3fc398ad1b36f969eb
2 files changed
+2
-8
packages/react-reconciler/src/ReactFiberHooks.new.js
+1
-4
@@ -1624,10 +1624,7 @@ function mountRef<T>(initialValue: T): {|current: T|} {
1624
},
1625
set current(value) {
1626
if (currentlyRenderingFiber !== null && !didWarnAboutWrite) {
1627
- if (
1628
- hasBeenInitialized ||
1629
- (!hasBeenInitialized && !didCheckForLazyInit)
1630
- ) {
1627
+ if (hasBeenInitialized || !didCheckForLazyInit) {
1628
didWarnAboutWrite = true;
1629
console.warn(
1630
'%s: Unsafe write of a mutable value during render.\n\n' +
packages/react-reconciler/src/ReactFiberHooks.old.js
+1
-4
@@ -1624,10 +1624,7 @@ function mountRef<T>(initialValue: T): {|current: T|} {
1624
},
1625
set current(value) {
1626
if (currentlyRenderingFiber !== null && !didWarnAboutWrite) {
1627
- if (
1628
- hasBeenInitialized ||
1629
- (!hasBeenInitialized && !didCheckForLazyInit)
1630
- ) {
1627
+ if (hasBeenInitialized || !didCheckForLazyInit) {
1628
didWarnAboutWrite = true;
1629
console.warn(
1630
'%s: Unsafe write of a mutable value during render.\n\n' +