Remove unnecessary check (#24332)

This commit is contained in:
zhoulixiang
2022-04-12 03:08:29 +08:00
committed by GitHub
parent d9a0f9e203
commit 01e2bff1dc
2 changed files with 2 additions and 8 deletions
@@ -1624,10 +1624,7 @@ function mountRef<T>(initialValue: T): {|current: T|} {
},
set current(value) {
if (currentlyRenderingFiber !== null && !didWarnAboutWrite) {
if (
hasBeenInitialized ||
(!hasBeenInitialized && !didCheckForLazyInit)
) {
if (hasBeenInitialized || !didCheckForLazyInit) {
didWarnAboutWrite = true;
console.warn(
'%s: Unsafe write of a mutable value during render.\n\n' +
@@ -1624,10 +1624,7 @@ function mountRef<T>(initialValue: T): {|current: T|} {
},
set current(value) {
if (currentlyRenderingFiber !== null && !didWarnAboutWrite) {
if (
hasBeenInitialized ||
(!hasBeenInitialized && !didCheckForLazyInit)
) {
if (hasBeenInitialized || !didCheckForLazyInit) {
didWarnAboutWrite = true;
console.warn(
'%s: Unsafe write of a mutable value during render.\n\n' +