Remove unnecessary check (#24332)

This commit is contained in:
zhoulixiang authored and GitHub committed 2022-04-11 20:08:29 +01:00
1 parent d9a0f9e203
commit 01e2bff1dc
2 files changed
+2 -8

No files matched your search

@@ -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' +