7
7
* @noflow
8
8
* @nolint
9
9
* @preventMunge
10
- * @generated SignedSource<<3a64021116badb6467add62a13ee5411 >>
10
+ * @generated SignedSource<<37663b716b538adcc88b05fc968e0638 >>
11
11
*/
12
12
13
13
"use strict";
@@ -850,6 +850,103 @@ if (__DEV__) {
850
850
var NormalPriority$1 = Scheduler$1.unstable_NormalPriority;
851
851
var IdlePriority = Scheduler$1.unstable_IdlePriority; // this doesn't actually exist on the scheduler, but it *does*
852
852
853
+ // Helpers to patch console.logs to avoid logging during side-effect free
854
+ // replaying on render function. This currently only patches the object
855
+ // lazily which won't cover if the log function was extracted eagerly.
856
+ // We could also eagerly patch the method.
857
+ var disabledDepth = 0;
858
+ var prevLog;
859
+ var prevInfo;
860
+ var prevWarn;
861
+ var prevError;
862
+ var prevGroup;
863
+ var prevGroupCollapsed;
864
+ var prevGroupEnd;
865
+
866
+ function disabledLog() {}
867
+
868
+ disabledLog.__reactDisabledLog = true;
869
+ function disableLogs() {
870
+ {
871
+ if (disabledDepth === 0) {
872
+ /* eslint-disable react-internal/no-production-logging */
873
+ prevLog = console.log;
874
+ prevInfo = console.info;
875
+ prevWarn = console.warn;
876
+ prevError = console.error;
877
+ prevGroup = console.group;
878
+ prevGroupCollapsed = console.groupCollapsed;
879
+ prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099
880
+
881
+ var props = {
882
+ configurable: true,
883
+ enumerable: true,
884
+ value: disabledLog,
885
+ writable: true
886
+ }; // $FlowFixMe[cannot-write] Flow thinks console is immutable.
887
+
888
+ Object.defineProperties(console, {
889
+ info: props,
890
+ log: props,
891
+ warn: props,
892
+ error: props,
893
+ group: props,
894
+ groupCollapsed: props,
895
+ groupEnd: props
896
+ });
897
+ /* eslint-enable react-internal/no-production-logging */
898
+ }
899
+
900
+ disabledDepth++;
901
+ }
902
+ }
903
+ function reenableLogs() {
904
+ {
905
+ disabledDepth--;
906
+
907
+ if (disabledDepth === 0) {
908
+ /* eslint-disable react-internal/no-production-logging */
909
+ var props = {
910
+ configurable: true,
911
+ enumerable: true,
912
+ writable: true
913
+ }; // $FlowFixMe[cannot-write] Flow thinks console is immutable.
914
+
915
+ Object.defineProperties(console, {
916
+ log: assign({}, props, {
917
+ value: prevLog
918
+ }),
919
+ info: assign({}, props, {
920
+ value: prevInfo
921
+ }),
922
+ warn: assign({}, props, {
923
+ value: prevWarn
924
+ }),
925
+ error: assign({}, props, {
926
+ value: prevError
927
+ }),
928
+ group: assign({}, props, {
929
+ value: prevGroup
930
+ }),
931
+ groupCollapsed: assign({}, props, {
932
+ value: prevGroupCollapsed
933
+ }),
934
+ groupEnd: assign({}, props, {
935
+ value: prevGroupEnd
936
+ })
937
+ });
938
+ /* eslint-enable react-internal/no-production-logging */
939
+ }
940
+
941
+ if (disabledDepth < 0) {
942
+ error(
943
+ "disabledDepth fell below zero. " +
944
+ "This is a bug in React. Please file an issue."
945
+ );
946
+ }
947
+ }
948
+ }
949
+
853
950
var rendererID = null;
854
951
var injectedHook = null;
855
952
var hasLoggedError = false;
@@ -1008,6 +1105,15 @@ if (__DEV__) {
1008
1105
}
1009
1106
}
1010
1107
}
1108
+ function setIsStrictModeForDevtools(newIsStrictMode) {
1109
+ {
1110
+ if (newIsStrictMode) {
1111
+ disableLogs();
1112
+ } else {
1113
+ reenableLogs();
1114
+ }
1115
+ }
1116
+ } // Profiler API hooks
1011
1117
1012
1118
function injectProfilingHooks(profilingHooks) {}
1013
1119
@@ -8759,12 +8865,14 @@ if (__DEV__) {
8759
8865
function mountMemo(nextCreate, deps) {
8760
8866
var hook = mountWorkInProgressHook();
8761
8867
var nextDeps = deps === undefined ? null : deps;
8868
+ var nextValue = nextCreate();
8762
8869
8763
8870
if (shouldDoubleInvokeUserFnsInHooksDEV) {
8871
+ setIsStrictModeForDevtools(true);
8764
8872
nextCreate();
8873
+ setIsStrictModeForDevtools(false);
8765
8874
}
8766
8875
8767
- var nextValue = nextCreate();
8768
8876
hook.memoizedState = [nextValue, nextDeps];
8769
8877
return nextValue;
8770
8878
}
@@ -8782,11 +8890,14 @@ if (__DEV__) {
8782
8890
}
8783
8891
}
8784
8892
8893
+ var nextValue = nextCreate();
8894
+
8785
8895
if (shouldDoubleInvokeUserFnsInHooksDEV) {
8896
+ setIsStrictModeForDevtools(true);
8786
8897
nextCreate();
8898
+ setIsStrictModeForDevtools(false);
8787
8899
}
8788
8900
8789
- var nextValue = nextCreate();
8790
8901
hook.memoizedState = [nextValue, nextDeps];
8791
8902
return nextValue;
8792
8903
}
@@ -25600,7 +25711,7 @@ if (__DEV__) {
25600
25711
return root;
25601
25712
}
25602
25713
25603
- var ReactVersion = "18.3.0-canary-12d56fca3 -20240206";
25714
+ var ReactVersion = "18.3.0-canary-db120f69e -20240206";
25604
25715
25605
25716
// Might add PROFILE later.
25606
25717
0 commit comments