Skip to content

Commit 52785f5

Browse files
zh-lxrickhanlonii
authored andcommitted
Remove unnecessary check (#24332)
1 parent 20671f8 commit 52785f5

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

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

+1-4
Original file line numberDiff line numberDiff line change
@@ -1624,10 +1624,7 @@ function mountRef<T>(initialValue: T): {|current: T|} {
16241624
},
16251625
set current(value) {
16261626
if (currentlyRenderingFiber !== null && !didWarnAboutWrite) {
1627-
if (
1628-
hasBeenInitialized ||
1629-
(!hasBeenInitialized && !didCheckForLazyInit)
1630-
) {
1627+
if (hasBeenInitialized || !didCheckForLazyInit) {
16311628
didWarnAboutWrite = true;
16321629
console.warn(
16331630
'%s: Unsafe write of a mutable value during render.\n\n' +

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

+1-4
Original file line numberDiff line numberDiff line change
@@ -1624,10 +1624,7 @@ function mountRef<T>(initialValue: T): {|current: T|} {
16241624
},
16251625
set current(value) {
16261626
if (currentlyRenderingFiber !== null && !didWarnAboutWrite) {
1627-
if (
1628-
hasBeenInitialized ||
1629-
(!hasBeenInitialized && !didCheckForLazyInit)
1630-
) {
1627+
if (hasBeenInitialized || !didCheckForLazyInit) {
16311628
didWarnAboutWrite = true;
16321629
console.warn(
16331630
'%s: Unsafe write of a mutable value during render.\n\n' +

0 commit comments

Comments
 (0)