@office-iss/react-native-win32 0.66.0 → 0.67.0-preview.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintignore +2 -0
- package/.flowconfig +1 -1
- package/CHANGELOG.json +195 -19
- package/CHANGELOG.md +89 -13
- package/Libraries/ActionSheetIOS/ActionSheetIOS.js +14 -1
- package/Libraries/ActionSheetIOS/NativeActionSheetManager.js +2 -0
- package/Libraries/Animated/AnimatedEvent.js +23 -4
- package/Libraries/Animated/NativeAnimatedHelper.js +2 -2
- package/Libraries/Animated/components/AnimatedImage.js +3 -3
- package/Libraries/Animated/components/AnimatedScrollView.js +3 -3
- package/Libraries/Animated/components/AnimatedText.js +3 -3
- package/Libraries/Animated/components/AnimatedView.js +1 -3
- package/Libraries/Animated/createAnimatedComponent.js +3 -34
- package/Libraries/Components/Button/ButtonWin32.js +2 -2
- package/Libraries/Components/Button/ButtonWin32.js.map +1 -1
- package/Libraries/Components/Button.js +3 -0
- package/Libraries/Components/DatePicker/DatePickerIOS.ios.js +3 -6
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js +4 -7
- package/Libraries/Components/EnterString.win32.js +3 -3
- package/Libraries/Components/EnterString.win32.js.map +1 -1
- package/Libraries/Components/ScrollView/AndroidHorizontalScrollViewNativeComponent.js +1 -0
- package/Libraries/Components/ScrollView/ScrollView.js +17 -16
- package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +268 -252
- package/Libraries/Components/Text/Tests/TextWin32Test.d.ts +0 -1
- package/Libraries/Components/Text/TextWin32.Props.d.ts +2 -2
- package/Libraries/Components/Text/TextWin32.Props.js.map +1 -1
- package/Libraries/Components/Text/TextWin32.js +1 -1
- package/Libraries/Components/Text/TextWin32.js.map +1 -1
- package/Libraries/Components/TextInput/Tests/TextInputTest.d.ts +0 -1
- package/Libraries/Components/TextInput/TextInput.win32.js +6 -6
- package/Libraries/Components/TextInput/TextInput.win32.js.map +1 -1
- package/Libraries/Components/Touchable/Tests/TouchableWin32Test.d.ts +0 -1
- package/Libraries/Components/Touchable/Tests/TouchableWin32Test.js +1 -1
- package/Libraries/Components/Touchable/Tests/TouchableWin32Test.js.map +1 -1
- package/Libraries/Components/Touchable/TouchableNativeFeedback.win32.js +2 -2
- package/Libraries/Components/Touchable/TouchableNativeFeedback.win32.js.map +1 -1
- package/Libraries/Components/Touchable/TouchableWin32.js +2 -2
- package/Libraries/Components/Touchable/TouchableWin32.js.map +1 -1
- package/Libraries/Components/View/ReactNativeViewViewConfig.win32.js +1 -0
- package/Libraries/Components/View/Tests/ViewWin32Test.d.ts +0 -1
- package/Libraries/Components/View/Tests/ViewWin32Test.js +44 -2
- package/Libraries/Components/View/Tests/ViewWin32Test.js.map +1 -1
- package/Libraries/Components/View/View.js +1 -1
- package/Libraries/Components/View/View.win32.js +1 -1
- package/Libraries/Components/View/ViewAccessibility.js +1 -1
- package/Libraries/Components/View/ViewWin32.Props.d.ts +4 -6
- package/Libraries/Components/View/ViewWin32.Props.js.map +1 -1
- package/Libraries/Components/View/ViewWin32.js +5 -5
- package/Libraries/Components/View/ViewWin32.js.map +1 -1
- package/Libraries/Core/ExceptionsManager.js +45 -80
- package/Libraries/Core/ExtendedError.js +0 -1
- package/Libraries/Core/ReactNativeVersion.js +2 -2
- package/Libraries/Core/setUpBatchedBridge.js +1 -1
- package/Libraries/Core/setUpGlobals.js +2 -4
- package/Libraries/Core/setUpTimers.js +2 -2
- package/Libraries/Image/Image.ios.js +6 -0
- package/Libraries/Image/Image.win32.js +6 -0
- package/Libraries/Image/ImageBackground.js +10 -8
- package/Libraries/Image/ImageProps.js +28 -0
- package/Libraries/Image/Tests/ImageWin32Test.d.ts +0 -1
- package/Libraries/LogBox/Data/LogBoxData.js +18 -19
- package/Libraries/LogBox/UI/LogBoxImages/alert-triangle.png +0 -0
- package/Libraries/LogBox/UI/LogBoxImages/chevron-left.png +0 -0
- package/Libraries/LogBox/UI/LogBoxImages/chevron-right.png +0 -0
- package/Libraries/LogBox/UI/LogBoxImages/close.png +0 -0
- package/Libraries/LogBox/UI/LogBoxImages/loader.png +0 -0
- package/Libraries/NewAppScreen/components/logo.png +0 -0
- package/Libraries/PermissionsAndroid/NativePermissionsAndroid.js +2 -1
- package/Libraries/PermissionsAndroid/PermissionsAndroid.js +2 -0
- package/Libraries/PersonaCoin/PersonaCoin.js +3 -2
- package/Libraries/PersonaCoin/PersonaCoin.js.map +1 -1
- package/Libraries/Pressability/Pressability.js +13 -13
- package/Libraries/Pressability/PressabilityPerformanceEventEmitter.js +1 -1
- package/Libraries/ReactNative/AppRegistry.js +4 -2
- package/Libraries/Renderer/implementations/ReactFabric-dev.fb.js +1569 -875
- package/Libraries/Renderer/implementations/ReactFabric-prod.fb.js +529 -319
- package/Libraries/Renderer/implementations/ReactFabric-profiling.fb.js +570 -362
- package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.fb.js +1592 -891
- package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.fb.js +521 -311
- package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.fb.js +562 -354
- package/Libraries/Share/Share.js +1 -1
- package/Libraries/StyleSheet/normalizeColor.js +2 -2
- package/Libraries/Text/TextProps.js +1 -7
- package/Libraries/TurboModule/TurboModuleRegistry.js +1 -1
- package/Libraries/Utilities/HMRClient.js +1 -1
- package/flow/global.js +45 -0
- package/index.js +15 -10
- package/index.win32.js +15 -10
- package/jest/mockModal.js +31 -0
- package/jest/setup.js +5 -3
- package/overrides.json +7 -13
- package/package.json +20 -18
- package/rntypes/BatchedBridge.d.ts +23 -0
- package/rntypes/Devtools.d.ts +20 -0
- package/rntypes/LaunchScreen.d.ts +9 -0
- package/rntypes/globals.d.ts +496 -0
- package/rntypes/index.d.ts +9966 -0
- package/rntypes/legacy-properties.d.ts +266 -0
- package/src/Libraries/Components/Text/TextWin32.Props.ts +2 -2
- package/src/Libraries/Components/View/Tests/ViewWin32Test.tsx +64 -0
- package/src/Libraries/Components/View/ViewWin32.Props.ts +7 -12
- package/src/rntypes/BatchedBridge.d.ts +23 -0
- package/src/rntypes/Devtools.d.ts +20 -0
- package/src/rntypes/LaunchScreen.d.ts +9 -0
- package/src/rntypes/globals.d.ts +496 -0
- package/src/rntypes/index.d.ts +9966 -0
- package/src/rntypes/legacy-properties.d.ts +266 -0
- package/src/typings-index.ts +11 -4
- package/typings-index.d.ts +3 -1
- package/typings-index.js +7 -5
- package/typings-index.js.map +1 -1
- package/Libraries/Components/DatePickerAndroid/DatePickerAndroid.android.js +0 -87
- package/Libraries/Components/DatePickerAndroid/DatePickerAndroid.ios.js +0 -30
- package/Libraries/Components/DatePickerAndroid/DatePickerAndroid.win32.js +0 -30
- package/Libraries/Components/DatePickerAndroid/DatePickerAndroidTypes.js +0 -30
- package/Libraries/Components/StaticContainer.react.js +0 -51
- package/Libraries/Components/Touchable/ensurePositiveDelayProps.js +0 -25
- package/Libraries/Interaction/InteractionMixin.js +0 -54
- package/Libraries/ReactNative/queryLayoutByID.js +0 -58
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* @noflow
|
|
8
8
|
* @nolint
|
|
9
9
|
* @preventMunge
|
|
10
|
-
* @generated SignedSource<<
|
|
10
|
+
* @generated SignedSource<<e138d52a3cd55cb99fd1f36b574256a6>>
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
'use strict';
|
|
@@ -32,32 +32,36 @@ var ReactSharedInternals =
|
|
|
32
32
|
|
|
33
33
|
function warn(format) {
|
|
34
34
|
{
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
35
|
+
{
|
|
36
|
+
for (
|
|
37
|
+
var _len = arguments.length,
|
|
38
|
+
args = new Array(_len > 1 ? _len - 1 : 0),
|
|
39
|
+
_key = 1;
|
|
40
|
+
_key < _len;
|
|
41
|
+
_key++
|
|
42
|
+
) {
|
|
43
|
+
args[_key - 1] = arguments[_key];
|
|
44
|
+
}
|
|
44
45
|
|
|
45
|
-
|
|
46
|
+
printWarning("warn", format, args);
|
|
47
|
+
}
|
|
46
48
|
}
|
|
47
49
|
}
|
|
48
50
|
function error(format) {
|
|
49
51
|
{
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
52
|
+
{
|
|
53
|
+
for (
|
|
54
|
+
var _len2 = arguments.length,
|
|
55
|
+
args = new Array(_len2 > 1 ? _len2 - 1 : 0),
|
|
56
|
+
_key2 = 1;
|
|
57
|
+
_key2 < _len2;
|
|
58
|
+
_key2++
|
|
59
|
+
) {
|
|
60
|
+
args[_key2 - 1] = arguments[_key2];
|
|
61
|
+
}
|
|
59
62
|
|
|
60
|
-
|
|
63
|
+
printWarning("error", format, args);
|
|
64
|
+
}
|
|
61
65
|
}
|
|
62
66
|
}
|
|
63
67
|
|
|
@@ -71,10 +75,10 @@ function printWarning(level, format, args) {
|
|
|
71
75
|
if (stack !== "") {
|
|
72
76
|
format += "%s";
|
|
73
77
|
args = args.concat([stack]);
|
|
74
|
-
}
|
|
78
|
+
} // eslint-disable-next-line react-internal/safe-string-coercion
|
|
75
79
|
|
|
76
80
|
var argsWithFormat = args.map(function(item) {
|
|
77
|
-
return
|
|
81
|
+
return String(item);
|
|
78
82
|
}); // Careful: RN currently depends on this prefix
|
|
79
83
|
|
|
80
84
|
argsWithFormat.unshift("Warning: " + format); // We intentionally don't use spread (or .apply) directly because it
|
|
@@ -141,9 +145,15 @@ var invokeGuardedCallbackImpl = invokeGuardedCallbackProd;
|
|
|
141
145
|
// when we call document.createEvent(). However this can cause confusing
|
|
142
146
|
// errors: https://github.com/facebook/create-react-app/issues/3482
|
|
143
147
|
// So we preemptively throw with a better message instead.
|
|
144
|
-
if (
|
|
145
|
-
throw Error(
|
|
146
|
-
"The `document` global was defined when React was initialized, but is not
|
|
148
|
+
if (typeof document === "undefined") {
|
|
149
|
+
throw new Error(
|
|
150
|
+
"The `document` global was defined when React was initialized, but is not " +
|
|
151
|
+
"defined anymore. This can happen in a test environment if a component " +
|
|
152
|
+
"schedules an update from an asynchronous callback, but the test has already " +
|
|
153
|
+
"finished running. To solve this, you can either unmount the component at " +
|
|
154
|
+
"the end of your test (and ensure that any asynchronous operations get " +
|
|
155
|
+
"canceled in `componentWillUnmount`), or you can change the test itself " +
|
|
156
|
+
"to be asynchronous."
|
|
147
157
|
);
|
|
148
158
|
}
|
|
149
159
|
|
|
@@ -249,6 +259,7 @@ var invokeGuardedCallbackImpl = invokeGuardedCallbackProd;
|
|
|
249
259
|
if (didCall && didError) {
|
|
250
260
|
if (!didSetError) {
|
|
251
261
|
// The callback errored, but the error event never fired.
|
|
262
|
+
// eslint-disable-next-line react-internal/prod-error-codes
|
|
252
263
|
error = new Error(
|
|
253
264
|
"An error was thrown inside one of your components, but React " +
|
|
254
265
|
"doesn't know what it was. This is likely due to browser " +
|
|
@@ -260,6 +271,7 @@ var invokeGuardedCallbackImpl = invokeGuardedCallbackProd;
|
|
|
260
271
|
"actually an issue with React, please file an issue."
|
|
261
272
|
);
|
|
262
273
|
} else if (isCrossOriginError) {
|
|
274
|
+
// eslint-disable-next-line react-internal/prod-error-codes
|
|
263
275
|
error = new Error(
|
|
264
276
|
"A cross-origin error was thrown. React doesn't have access to " +
|
|
265
277
|
"the actual error object in development. " +
|
|
@@ -372,11 +384,10 @@ function clearCaughtError() {
|
|
|
372
384
|
caughtError = null;
|
|
373
385
|
return error;
|
|
374
386
|
} else {
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
"
|
|
378
|
-
|
|
379
|
-
}
|
|
387
|
+
throw new Error(
|
|
388
|
+
"clearCaughtError was called but no error was captured. This error " +
|
|
389
|
+
"is likely caused by a bug in React. Please file an issue."
|
|
390
|
+
);
|
|
380
391
|
}
|
|
381
392
|
}
|
|
382
393
|
|
|
@@ -533,8 +544,8 @@ function executeDirectDispatch(event) {
|
|
|
533
544
|
var dispatchListener = event._dispatchListeners;
|
|
534
545
|
var dispatchInstance = event._dispatchInstances;
|
|
535
546
|
|
|
536
|
-
if (
|
|
537
|
-
throw Error("executeDirectDispatch(...): Invalid `event`.");
|
|
547
|
+
if (isArray(dispatchListener)) {
|
|
548
|
+
throw new Error("executeDirectDispatch(...): Invalid `event`.");
|
|
538
549
|
}
|
|
539
550
|
|
|
540
551
|
event.currentTarget = dispatchListener
|
|
@@ -555,6 +566,7 @@ function hasDispatches(event) {
|
|
|
555
566
|
return !!event._dispatchListeners;
|
|
556
567
|
}
|
|
557
568
|
|
|
569
|
+
/* eslint valid-typeof: 0 */
|
|
558
570
|
var EVENT_POOL_SIZE = 10;
|
|
559
571
|
/**
|
|
560
572
|
* @interface Event
|
|
@@ -881,7 +893,7 @@ function releasePooledEvent(event) {
|
|
|
881
893
|
var EventConstructor = this;
|
|
882
894
|
|
|
883
895
|
if (!(event instanceof EventConstructor)) {
|
|
884
|
-
throw Error(
|
|
896
|
+
throw new Error(
|
|
885
897
|
"Trying to release an event instance into a pool of a different type."
|
|
886
898
|
);
|
|
887
899
|
}
|
|
@@ -990,8 +1002,8 @@ function resetTouchRecord(touchRecord, touch) {
|
|
|
990
1002
|
function getTouchIdentifier(_ref) {
|
|
991
1003
|
var identifier = _ref.identifier;
|
|
992
1004
|
|
|
993
|
-
if (
|
|
994
|
-
throw Error("Touch object is missing identifier.");
|
|
1005
|
+
if (identifier == null) {
|
|
1006
|
+
throw new Error("Touch object is missing identifier.");
|
|
995
1007
|
}
|
|
996
1008
|
|
|
997
1009
|
{
|
|
@@ -1149,8 +1161,8 @@ var ResponderTouchHistoryStore = {
|
|
|
1149
1161
|
*/
|
|
1150
1162
|
|
|
1151
1163
|
function accumulate(current, next) {
|
|
1152
|
-
if (
|
|
1153
|
-
throw Error(
|
|
1164
|
+
if (next == null) {
|
|
1165
|
+
throw new Error(
|
|
1154
1166
|
"accumulate(...): Accumulated items must not be null or undefined."
|
|
1155
1167
|
);
|
|
1156
1168
|
}
|
|
@@ -1185,8 +1197,8 @@ function accumulate(current, next) {
|
|
|
1185
1197
|
*/
|
|
1186
1198
|
|
|
1187
1199
|
function accumulateInto(current, next) {
|
|
1188
|
-
if (
|
|
1189
|
-
throw Error(
|
|
1200
|
+
if (next == null) {
|
|
1201
|
+
throw new Error(
|
|
1190
1202
|
"accumulateInto(...): Accumulated items must not be null or undefined."
|
|
1191
1203
|
);
|
|
1192
1204
|
}
|
|
@@ -1492,8 +1504,8 @@ function getListener(inst, registrationName) {
|
|
|
1492
1504
|
|
|
1493
1505
|
var listener = props[registrationName];
|
|
1494
1506
|
|
|
1495
|
-
if (
|
|
1496
|
-
throw Error(
|
|
1507
|
+
if (listener && typeof listener !== "function") {
|
|
1508
|
+
throw new Error(
|
|
1497
1509
|
"Expected `" +
|
|
1498
1510
|
registrationName +
|
|
1499
1511
|
"` listener to be a function, instead got a value of `" +
|
|
@@ -2075,11 +2087,10 @@ function recomputePluginOrdering() {
|
|
|
2075
2087
|
var pluginModule = namesToPlugins[pluginName];
|
|
2076
2088
|
var pluginIndex = eventPluginOrder.indexOf(pluginName);
|
|
2077
2089
|
|
|
2078
|
-
if (
|
|
2079
|
-
throw Error(
|
|
2080
|
-
"EventPluginRegistry: Cannot inject event plugins that do not exist in
|
|
2081
|
-
pluginName +
|
|
2082
|
-
"`."
|
|
2090
|
+
if (pluginIndex <= -1) {
|
|
2091
|
+
throw new Error(
|
|
2092
|
+
"EventPluginRegistry: Cannot inject event plugins that do not exist in " +
|
|
2093
|
+
("the plugin ordering, `" + pluginName + "`.")
|
|
2083
2094
|
);
|
|
2084
2095
|
}
|
|
2085
2096
|
|
|
@@ -2088,10 +2099,9 @@ function recomputePluginOrdering() {
|
|
|
2088
2099
|
}
|
|
2089
2100
|
|
|
2090
2101
|
if (!pluginModule.extractEvents) {
|
|
2091
|
-
throw Error(
|
|
2092
|
-
"EventPluginRegistry: Event plugins must implement an `extractEvents`
|
|
2093
|
-
pluginName +
|
|
2094
|
-
"` does not."
|
|
2102
|
+
throw new Error(
|
|
2103
|
+
"EventPluginRegistry: Event plugins must implement an `extractEvents` " +
|
|
2104
|
+
("method, but `" + pluginName + "` does not.")
|
|
2095
2105
|
);
|
|
2096
2106
|
}
|
|
2097
2107
|
|
|
@@ -2106,7 +2116,7 @@ function recomputePluginOrdering() {
|
|
|
2106
2116
|
eventName
|
|
2107
2117
|
)
|
|
2108
2118
|
) {
|
|
2109
|
-
throw Error(
|
|
2119
|
+
throw new Error(
|
|
2110
2120
|
"EventPluginRegistry: Failed to publish event `" +
|
|
2111
2121
|
eventName +
|
|
2112
2122
|
"` for plugin `" +
|
|
@@ -2127,11 +2137,10 @@ function recomputePluginOrdering() {
|
|
|
2127
2137
|
*/
|
|
2128
2138
|
|
|
2129
2139
|
function publishEventForPlugin(dispatchConfig, pluginModule, eventName) {
|
|
2130
|
-
if (
|
|
2131
|
-
throw Error(
|
|
2132
|
-
"EventPluginRegistry: More than one plugin attempted to publish the same
|
|
2133
|
-
eventName +
|
|
2134
|
-
"`."
|
|
2140
|
+
if (eventNameDispatchConfigs.hasOwnProperty(eventName)) {
|
|
2141
|
+
throw new Error(
|
|
2142
|
+
"EventPluginRegistry: More than one plugin attempted to publish the same " +
|
|
2143
|
+
("event name, `" + eventName + "`.")
|
|
2135
2144
|
);
|
|
2136
2145
|
}
|
|
2137
2146
|
|
|
@@ -2171,11 +2180,10 @@ function publishEventForPlugin(dispatchConfig, pluginModule, eventName) {
|
|
|
2171
2180
|
*/
|
|
2172
2181
|
|
|
2173
2182
|
function publishRegistrationName(registrationName, pluginModule, eventName) {
|
|
2174
|
-
if (
|
|
2175
|
-
throw Error(
|
|
2176
|
-
"EventPluginRegistry: More than one plugin attempted to publish the same
|
|
2177
|
-
registrationName +
|
|
2178
|
-
"`."
|
|
2183
|
+
if (registrationNameModules[registrationName]) {
|
|
2184
|
+
throw new Error(
|
|
2185
|
+
"EventPluginRegistry: More than one plugin attempted to publish the same " +
|
|
2186
|
+
("registration name, `" + registrationName + "`.")
|
|
2179
2187
|
);
|
|
2180
2188
|
}
|
|
2181
2189
|
|
|
@@ -2222,9 +2230,10 @@ var registrationNameDependencies = {};
|
|
|
2222
2230
|
*/
|
|
2223
2231
|
|
|
2224
2232
|
function injectEventPluginOrder(injectedEventPluginOrder) {
|
|
2225
|
-
if (
|
|
2226
|
-
throw Error(
|
|
2227
|
-
"EventPluginRegistry: Cannot inject event plugin ordering more than
|
|
2233
|
+
if (eventPluginOrder) {
|
|
2234
|
+
throw new Error(
|
|
2235
|
+
"EventPluginRegistry: Cannot inject event plugin ordering more than " +
|
|
2236
|
+
"once. You are likely trying to load more than one copy of React."
|
|
2228
2237
|
);
|
|
2229
2238
|
} // Clone the ordering so it cannot be dynamically mutated.
|
|
2230
2239
|
|
|
@@ -2255,11 +2264,10 @@ function injectEventPluginsByName(injectedNamesToPlugins) {
|
|
|
2255
2264
|
!namesToPlugins.hasOwnProperty(pluginName) ||
|
|
2256
2265
|
namesToPlugins[pluginName] !== pluginModule
|
|
2257
2266
|
) {
|
|
2258
|
-
if (
|
|
2259
|
-
throw Error(
|
|
2260
|
-
"EventPluginRegistry: Cannot inject two different event plugins
|
|
2261
|
-
pluginName +
|
|
2262
|
-
"`."
|
|
2267
|
+
if (namesToPlugins[pluginName]) {
|
|
2268
|
+
throw new Error(
|
|
2269
|
+
"EventPluginRegistry: Cannot inject two different event plugins " +
|
|
2270
|
+
("using the same name, `" + pluginName + "`.")
|
|
2263
2271
|
);
|
|
2264
2272
|
}
|
|
2265
2273
|
|
|
@@ -2290,8 +2298,8 @@ function getListener$1(inst, registrationName) {
|
|
|
2290
2298
|
|
|
2291
2299
|
var listener = props[registrationName];
|
|
2292
2300
|
|
|
2293
|
-
if (
|
|
2294
|
-
throw Error(
|
|
2301
|
+
if (listener && typeof listener !== "function") {
|
|
2302
|
+
throw new Error(
|
|
2295
2303
|
"Expected `" +
|
|
2296
2304
|
registrationName +
|
|
2297
2305
|
"` listener to be a function, instead got a value of `" +
|
|
@@ -2439,8 +2447,8 @@ var ReactNativeBridgeEventPlugin = {
|
|
|
2439
2447
|
var bubbleDispatchConfig = customBubblingEventTypes[topLevelType];
|
|
2440
2448
|
var directDispatchConfig = customDirectEventTypes[topLevelType];
|
|
2441
2449
|
|
|
2442
|
-
if (!
|
|
2443
|
-
throw Error(
|
|
2450
|
+
if (!bubbleDispatchConfig && !directDispatchConfig) {
|
|
2451
|
+
throw new Error( // $FlowFixMe - Flow doesn't like this string coercion because DOMTopLevelEventType is opaque
|
|
2444
2452
|
'Unsupported top level event type "' + topLevelType + '" dispatched'
|
|
2445
2453
|
);
|
|
2446
2454
|
}
|
|
@@ -2514,7 +2522,7 @@ function getTagFromInstance(inst) {
|
|
|
2514
2522
|
}
|
|
2515
2523
|
|
|
2516
2524
|
if (!tag) {
|
|
2517
|
-
throw Error("All native instances should have a tag.");
|
|
2525
|
+
throw new Error("All native instances should have a tag.");
|
|
2518
2526
|
}
|
|
2519
2527
|
|
|
2520
2528
|
return nativeInstance;
|
|
@@ -2598,9 +2606,10 @@ function runEventsInBatch(events) {
|
|
|
2598
2606
|
|
|
2599
2607
|
forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseTopLevel);
|
|
2600
2608
|
|
|
2601
|
-
if (
|
|
2602
|
-
throw Error(
|
|
2603
|
-
"processEventQueue(): Additional events were enqueued while processing
|
|
2609
|
+
if (eventQueue) {
|
|
2610
|
+
throw new Error(
|
|
2611
|
+
"processEventQueue(): Additional events were enqueued while processing " +
|
|
2612
|
+
"an event queue. Support for this has not yet been implemented."
|
|
2604
2613
|
);
|
|
2605
2614
|
} // This would be a good time to rethrow if any of the event handlers threw.
|
|
2606
2615
|
|
|
@@ -3132,10 +3141,12 @@ function getComponentNameFromFiber(fiber) {
|
|
|
3132
3141
|
|
|
3133
3142
|
var enablePersistentOffscreenHostContainer =
|
|
3134
3143
|
dynamicFlags.enablePersistentOffscreenHostContainer; // The rest of the flags are static for better dead code elimination.
|
|
3144
|
+
var enableSchedulingProfiler = false;
|
|
3135
3145
|
var enableProfilerTimer = true;
|
|
3136
3146
|
var enableProfilerCommitHooks = true;
|
|
3137
3147
|
var enableLazyElements = false;
|
|
3138
3148
|
var warnAboutStringRefs = false;
|
|
3149
|
+
var warnOnSubscriptionInsideStartTransition = false;
|
|
3139
3150
|
var enableNewReconciler = false;
|
|
3140
3151
|
var enableLazyContextPropagation = false;
|
|
3141
3152
|
|
|
@@ -3170,37 +3181,41 @@ var DidCapture =
|
|
|
3170
3181
|
128;
|
|
3171
3182
|
var Ref =
|
|
3172
3183
|
/* */
|
|
3173
|
-
|
|
3184
|
+
512;
|
|
3174
3185
|
var Snapshot =
|
|
3175
3186
|
/* */
|
|
3176
|
-
|
|
3187
|
+
1024;
|
|
3177
3188
|
var Passive =
|
|
3178
3189
|
/* */
|
|
3179
|
-
|
|
3190
|
+
2048;
|
|
3180
3191
|
var Hydrating =
|
|
3181
3192
|
/* */
|
|
3182
|
-
|
|
3193
|
+
4096;
|
|
3183
3194
|
var HydratingAndUpdate =
|
|
3184
3195
|
/* */
|
|
3185
3196
|
Hydrating | Update;
|
|
3186
3197
|
var Visibility =
|
|
3187
3198
|
/* */
|
|
3188
|
-
|
|
3189
|
-
var
|
|
3199
|
+
8192;
|
|
3200
|
+
var StoreConsistency =
|
|
3201
|
+
/* */
|
|
3202
|
+
16384;
|
|
3203
|
+
var LifecycleEffectMask =
|
|
3204
|
+
Passive | Update | Callback | Ref | Snapshot | StoreConsistency; // Union of all commit flags (flags with the lifetime of a particular commit)
|
|
3190
3205
|
|
|
3191
3206
|
var HostEffectMask =
|
|
3192
3207
|
/* */
|
|
3193
|
-
|
|
3208
|
+
32767; // These are not really side effects, but we still reuse this field.
|
|
3194
3209
|
|
|
3195
3210
|
var Incomplete =
|
|
3196
3211
|
/* */
|
|
3197
|
-
|
|
3212
|
+
32768;
|
|
3198
3213
|
var ShouldCapture =
|
|
3199
3214
|
/* */
|
|
3200
|
-
|
|
3215
|
+
65536;
|
|
3201
3216
|
var ForceUpdateForLegacySuspense =
|
|
3202
3217
|
/* */
|
|
3203
|
-
|
|
3218
|
+
131072;
|
|
3204
3219
|
// e.g. a fiber uses a passive effect (even if there are no updates on this particular render).
|
|
3205
3220
|
// This enables us to defer more work in the unmount case,
|
|
3206
3221
|
// since we can defer traversing the tree during layout to look for Passive effects,
|
|
@@ -3208,22 +3223,22 @@ var ForceUpdateForLegacySuspense =
|
|
|
3208
3223
|
|
|
3209
3224
|
var RefStatic =
|
|
3210
3225
|
/* */
|
|
3211
|
-
|
|
3226
|
+
1048576;
|
|
3212
3227
|
var LayoutStatic =
|
|
3213
3228
|
/* */
|
|
3214
|
-
|
|
3229
|
+
2097152;
|
|
3215
3230
|
var PassiveStatic =
|
|
3216
3231
|
/* */
|
|
3217
|
-
|
|
3232
|
+
4194304; // These flags allow us to traverse to fibers that have effects on mount
|
|
3218
3233
|
// without traversing the entire tree after every commit for
|
|
3219
3234
|
// double invoking
|
|
3220
3235
|
|
|
3221
3236
|
var MountLayoutDev =
|
|
3222
3237
|
/* */
|
|
3223
|
-
|
|
3238
|
+
8388608;
|
|
3224
3239
|
var MountPassiveDev =
|
|
3225
3240
|
/* */
|
|
3226
|
-
|
|
3241
|
+
16777216; // Groups of flags that are used in the commit phase to skip over trees that
|
|
3227
3242
|
// don't contain effects, by checking subtreeFlags.
|
|
3228
3243
|
|
|
3229
3244
|
var BeforeMutationMask = // TODO: Remove Update flag from before mutation phase by re-landing Visibility
|
|
@@ -3318,8 +3333,8 @@ function isMounted(component) {
|
|
|
3318
3333
|
}
|
|
3319
3334
|
|
|
3320
3335
|
function assertIsMounted(fiber) {
|
|
3321
|
-
if (
|
|
3322
|
-
throw Error("Unable to find node on an unmounted component.");
|
|
3336
|
+
if (getNearestMountedFiber(fiber) !== fiber) {
|
|
3337
|
+
throw new Error("Unable to find node on an unmounted component.");
|
|
3323
3338
|
}
|
|
3324
3339
|
}
|
|
3325
3340
|
|
|
@@ -3330,8 +3345,8 @@ function findCurrentFiberUsingSlowPath(fiber) {
|
|
|
3330
3345
|
// If there is no alternate, then we only need to check if it is mounted.
|
|
3331
3346
|
var nearestMounted = getNearestMountedFiber(fiber);
|
|
3332
3347
|
|
|
3333
|
-
if (
|
|
3334
|
-
throw Error("Unable to find node on an unmounted component.");
|
|
3348
|
+
if (nearestMounted === null) {
|
|
3349
|
+
throw new Error("Unable to find node on an unmounted component.");
|
|
3335
3350
|
}
|
|
3336
3351
|
|
|
3337
3352
|
if (nearestMounted !== fiber) {
|
|
@@ -3393,9 +3408,7 @@ function findCurrentFiberUsingSlowPath(fiber) {
|
|
|
3393
3408
|
} // We should never have an alternate for any mounting node. So the only
|
|
3394
3409
|
// way this could possibly happen is if this was unmounted, if at all.
|
|
3395
3410
|
|
|
3396
|
-
|
|
3397
|
-
throw Error("Unable to find node on an unmounted component.");
|
|
3398
|
-
}
|
|
3411
|
+
throw new Error("Unable to find node on an unmounted component.");
|
|
3399
3412
|
}
|
|
3400
3413
|
|
|
3401
3414
|
if (a.return !== b.return) {
|
|
@@ -3455,23 +3468,25 @@ function findCurrentFiberUsingSlowPath(fiber) {
|
|
|
3455
3468
|
}
|
|
3456
3469
|
|
|
3457
3470
|
if (!didFindChild) {
|
|
3458
|
-
throw Error(
|
|
3459
|
-
"Child was not found in either parent set. This indicates a bug
|
|
3471
|
+
throw new Error(
|
|
3472
|
+
"Child was not found in either parent set. This indicates a bug " +
|
|
3473
|
+
"in React related to the return pointer. Please file an issue."
|
|
3460
3474
|
);
|
|
3461
3475
|
}
|
|
3462
3476
|
}
|
|
3463
3477
|
}
|
|
3464
3478
|
|
|
3465
|
-
if (
|
|
3466
|
-
throw Error(
|
|
3467
|
-
"Return fibers should always be each others' alternates.
|
|
3479
|
+
if (a.alternate !== b) {
|
|
3480
|
+
throw new Error(
|
|
3481
|
+
"Return fibers should always be each others' alternates. " +
|
|
3482
|
+
"This error is likely caused by a bug in React. Please file an issue."
|
|
3468
3483
|
);
|
|
3469
3484
|
}
|
|
3470
3485
|
} // If the root is not a host container, we're in a disconnected tree. I.e.
|
|
3471
3486
|
// unmounted.
|
|
3472
3487
|
|
|
3473
|
-
if (
|
|
3474
|
-
throw Error("Unable to find node on an unmounted component.");
|
|
3488
|
+
if (a.tag !== HostRoot) {
|
|
3489
|
+
throw new Error("Unable to find node on an unmounted component.");
|
|
3475
3490
|
}
|
|
3476
3491
|
|
|
3477
3492
|
if (a.stateNode.current === a) {
|
|
@@ -4122,6 +4137,103 @@ var UserBlockingPriority = Scheduler.unstable_UserBlockingPriority;
|
|
|
4122
4137
|
var NormalPriority = Scheduler.unstable_NormalPriority;
|
|
4123
4138
|
var IdlePriority = Scheduler.unstable_IdlePriority;
|
|
4124
4139
|
|
|
4140
|
+
// Helpers to patch console.logs to avoid logging during side-effect free
|
|
4141
|
+
// replaying on render function. This currently only patches the object
|
|
4142
|
+
// lazily which won't cover if the log function was extracted eagerly.
|
|
4143
|
+
// We could also eagerly patch the method.
|
|
4144
|
+
var disabledDepth = 0;
|
|
4145
|
+
var prevLog;
|
|
4146
|
+
var prevInfo;
|
|
4147
|
+
var prevWarn;
|
|
4148
|
+
var prevError;
|
|
4149
|
+
var prevGroup;
|
|
4150
|
+
var prevGroupCollapsed;
|
|
4151
|
+
var prevGroupEnd;
|
|
4152
|
+
|
|
4153
|
+
function disabledLog() {}
|
|
4154
|
+
|
|
4155
|
+
disabledLog.__reactDisabledLog = true;
|
|
4156
|
+
function disableLogs() {
|
|
4157
|
+
{
|
|
4158
|
+
if (disabledDepth === 0) {
|
|
4159
|
+
/* eslint-disable react-internal/no-production-logging */
|
|
4160
|
+
prevLog = console.log;
|
|
4161
|
+
prevInfo = console.info;
|
|
4162
|
+
prevWarn = console.warn;
|
|
4163
|
+
prevError = console.error;
|
|
4164
|
+
prevGroup = console.group;
|
|
4165
|
+
prevGroupCollapsed = console.groupCollapsed;
|
|
4166
|
+
prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099
|
|
4167
|
+
|
|
4168
|
+
var props = {
|
|
4169
|
+
configurable: true,
|
|
4170
|
+
enumerable: true,
|
|
4171
|
+
value: disabledLog,
|
|
4172
|
+
writable: true
|
|
4173
|
+
}; // $FlowFixMe Flow thinks console is immutable.
|
|
4174
|
+
|
|
4175
|
+
Object.defineProperties(console, {
|
|
4176
|
+
info: props,
|
|
4177
|
+
log: props,
|
|
4178
|
+
warn: props,
|
|
4179
|
+
error: props,
|
|
4180
|
+
group: props,
|
|
4181
|
+
groupCollapsed: props,
|
|
4182
|
+
groupEnd: props
|
|
4183
|
+
});
|
|
4184
|
+
/* eslint-enable react-internal/no-production-logging */
|
|
4185
|
+
}
|
|
4186
|
+
|
|
4187
|
+
disabledDepth++;
|
|
4188
|
+
}
|
|
4189
|
+
}
|
|
4190
|
+
function reenableLogs() {
|
|
4191
|
+
{
|
|
4192
|
+
disabledDepth--;
|
|
4193
|
+
|
|
4194
|
+
if (disabledDepth === 0) {
|
|
4195
|
+
/* eslint-disable react-internal/no-production-logging */
|
|
4196
|
+
var props = {
|
|
4197
|
+
configurable: true,
|
|
4198
|
+
enumerable: true,
|
|
4199
|
+
writable: true
|
|
4200
|
+
}; // $FlowFixMe Flow thinks console is immutable.
|
|
4201
|
+
|
|
4202
|
+
Object.defineProperties(console, {
|
|
4203
|
+
log: Object.assign({}, props, {
|
|
4204
|
+
value: prevLog
|
|
4205
|
+
}),
|
|
4206
|
+
info: Object.assign({}, props, {
|
|
4207
|
+
value: prevInfo
|
|
4208
|
+
}),
|
|
4209
|
+
warn: Object.assign({}, props, {
|
|
4210
|
+
value: prevWarn
|
|
4211
|
+
}),
|
|
4212
|
+
error: Object.assign({}, props, {
|
|
4213
|
+
value: prevError
|
|
4214
|
+
}),
|
|
4215
|
+
group: Object.assign({}, props, {
|
|
4216
|
+
value: prevGroup
|
|
4217
|
+
}),
|
|
4218
|
+
groupCollapsed: Object.assign({}, props, {
|
|
4219
|
+
value: prevGroupCollapsed
|
|
4220
|
+
}),
|
|
4221
|
+
groupEnd: Object.assign({}, props, {
|
|
4222
|
+
value: prevGroupEnd
|
|
4223
|
+
})
|
|
4224
|
+
});
|
|
4225
|
+
/* eslint-enable react-internal/no-production-logging */
|
|
4226
|
+
}
|
|
4227
|
+
|
|
4228
|
+
if (disabledDepth < 0) {
|
|
4229
|
+
error(
|
|
4230
|
+
"disabledDepth fell below zero. " +
|
|
4231
|
+
"This is a bug in React. Please file an issue."
|
|
4232
|
+
);
|
|
4233
|
+
}
|
|
4234
|
+
}
|
|
4235
|
+
}
|
|
4236
|
+
|
|
4125
4237
|
var rendererID = null;
|
|
4126
4238
|
var injectedHook = null;
|
|
4127
4239
|
var hasLoggedError = false;
|
|
@@ -4273,6 +4385,15 @@ function onCommitUnmount(fiber) {
|
|
|
4273
4385
|
}
|
|
4274
4386
|
}
|
|
4275
4387
|
}
|
|
4388
|
+
function setIsStrictModeForDevtools(newIsStrictMode) {
|
|
4389
|
+
{
|
|
4390
|
+
if (newIsStrictMode) {
|
|
4391
|
+
disableLogs();
|
|
4392
|
+
} else {
|
|
4393
|
+
reenableLogs();
|
|
4394
|
+
}
|
|
4395
|
+
}
|
|
4396
|
+
}
|
|
4276
4397
|
|
|
4277
4398
|
var NoMode =
|
|
4278
4399
|
/* */
|
|
@@ -4738,16 +4859,10 @@ function includesOnlyRetries(lanes) {
|
|
|
4738
4859
|
function includesOnlyTransitions(lanes) {
|
|
4739
4860
|
return (lanes & TransitionLanes) === lanes;
|
|
4740
4861
|
}
|
|
4741
|
-
function
|
|
4742
|
-
if ((lanes & root.expiredLanes) !== NoLanes) {
|
|
4743
|
-
// At least one of these lanes expired. To prevent additional starvation,
|
|
4744
|
-
// finish rendering without yielding execution.
|
|
4745
|
-
return false;
|
|
4746
|
-
}
|
|
4747
|
-
|
|
4862
|
+
function includesBlockingLane(root, lanes) {
|
|
4748
4863
|
if ((root.current.mode & ConcurrentUpdatesByDefaultMode) !== NoMode) {
|
|
4749
4864
|
// Concurrent updates by default always use time slicing.
|
|
4750
|
-
return
|
|
4865
|
+
return false;
|
|
4751
4866
|
}
|
|
4752
4867
|
|
|
4753
4868
|
var SyncDefaultLanes =
|
|
@@ -4755,7 +4870,12 @@ function shouldTimeSlice(root, lanes) {
|
|
|
4755
4870
|
InputContinuousLane |
|
|
4756
4871
|
DefaultHydrationLane |
|
|
4757
4872
|
DefaultLane;
|
|
4758
|
-
return (lanes & SyncDefaultLanes)
|
|
4873
|
+
return (lanes & SyncDefaultLanes) !== NoLanes;
|
|
4874
|
+
}
|
|
4875
|
+
function includesExpiredLane(root, lanes) {
|
|
4876
|
+
// This is a separate check from includesBlockingLane because a lane can
|
|
4877
|
+
// expire after a render has already started.
|
|
4878
|
+
return (lanes & root.expiredLanes) !== NoLanes;
|
|
4759
4879
|
}
|
|
4760
4880
|
function isTransitionLane(lane) {
|
|
4761
4881
|
return (lane & TransitionLanes) !== 0;
|
|
@@ -5029,33 +5149,34 @@ function lanesToEventPriority(lanes) {
|
|
|
5029
5149
|
return IdleEventPriority;
|
|
5030
5150
|
}
|
|
5031
5151
|
|
|
5152
|
+
// Renderers that don't support persistence
|
|
5032
5153
|
// can re-export everything from this module.
|
|
5033
|
-
|
|
5034
5154
|
function shim() {
|
|
5035
|
-
|
|
5036
|
-
|
|
5037
|
-
"
|
|
5038
|
-
|
|
5039
|
-
|
|
5155
|
+
throw new Error(
|
|
5156
|
+
"The current renderer does not support persistence. " +
|
|
5157
|
+
"This error is likely caused by a bug in React. " +
|
|
5158
|
+
"Please file an issue."
|
|
5159
|
+
);
|
|
5040
5160
|
} // Persistence (when unsupported)
|
|
5041
5161
|
|
|
5042
5162
|
var supportsPersistence = false;
|
|
5043
5163
|
var getOffscreenContainerProps = shim;
|
|
5044
5164
|
|
|
5165
|
+
// Renderers that don't support hydration
|
|
5045
5166
|
// can re-export everything from this module.
|
|
5046
|
-
|
|
5047
5167
|
function shim$1() {
|
|
5048
|
-
|
|
5049
|
-
|
|
5050
|
-
"
|
|
5051
|
-
|
|
5052
|
-
|
|
5168
|
+
throw new Error(
|
|
5169
|
+
"The current renderer does not support hydration. " +
|
|
5170
|
+
"This error is likely caused by a bug in React. " +
|
|
5171
|
+
"Please file an issue."
|
|
5172
|
+
);
|
|
5053
5173
|
} // Hydration (when unsupported)
|
|
5054
5174
|
var isSuspenseInstancePending = shim$1;
|
|
5055
5175
|
var isSuspenseInstanceFallback = shim$1;
|
|
5056
5176
|
var hydrateTextInstance = shim$1;
|
|
5057
5177
|
var errorHydratingContainer = shim$1;
|
|
5058
5178
|
|
|
5179
|
+
// Modules provided by RN:
|
|
5059
5180
|
var getViewConfigForType =
|
|
5060
5181
|
ReactNativePrivateInterface.ReactNativeViewConfigRegistry.get;
|
|
5061
5182
|
var UPDATE_SIGNAL = {};
|
|
@@ -5137,7 +5258,7 @@ function createTextInstance(
|
|
|
5137
5258
|
internalInstanceHandle
|
|
5138
5259
|
) {
|
|
5139
5260
|
if (!hostContext.isInAParentText) {
|
|
5140
|
-
throw Error("Text strings must be rendered within a <Text> component.");
|
|
5261
|
+
throw new Error("Text strings must be rendered within a <Text> component.");
|
|
5141
5262
|
}
|
|
5142
5263
|
|
|
5143
5264
|
var tag = allocateTag();
|
|
@@ -5336,8 +5457,8 @@ function insertInContainerBefore(parentInstance, child, beforeChild) {
|
|
|
5336
5457
|
// We create a wrapper object for the container in ReactNative render()
|
|
5337
5458
|
// Or we refactor to remove wrapper objects entirely.
|
|
5338
5459
|
// For more info on pros/cons see PR #8560 description.
|
|
5339
|
-
if (
|
|
5340
|
-
throw Error("Container does not support insertBefore operation");
|
|
5460
|
+
if (typeof parentInstance === "number") {
|
|
5461
|
+
throw new Error("Container does not support insertBefore operation");
|
|
5341
5462
|
}
|
|
5342
5463
|
}
|
|
5343
5464
|
function removeChild(parentInstance, child) {
|
|
@@ -5421,150 +5542,53 @@ function preparePortalMount(portalInstance) {
|
|
|
5421
5542
|
// noop
|
|
5422
5543
|
}
|
|
5423
5544
|
|
|
5424
|
-
|
|
5425
|
-
|
|
5426
|
-
|
|
5427
|
-
|
|
5428
|
-
var disabledDepth = 0;
|
|
5429
|
-
var prevLog;
|
|
5430
|
-
var prevInfo;
|
|
5431
|
-
var prevWarn;
|
|
5432
|
-
var prevError;
|
|
5433
|
-
var prevGroup;
|
|
5434
|
-
var prevGroupCollapsed;
|
|
5435
|
-
var prevGroupEnd;
|
|
5545
|
+
var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
|
|
5546
|
+
function describeBuiltInComponentFrame(name, source, ownerFn) {
|
|
5547
|
+
{
|
|
5548
|
+
var ownerName = null;
|
|
5436
5549
|
|
|
5437
|
-
|
|
5550
|
+
if (ownerFn) {
|
|
5551
|
+
ownerName = ownerFn.displayName || ownerFn.name || null;
|
|
5552
|
+
}
|
|
5438
5553
|
|
|
5439
|
-
|
|
5440
|
-
|
|
5441
|
-
|
|
5442
|
-
|
|
5443
|
-
/* eslint-disable react-internal/no-production-logging */
|
|
5444
|
-
prevLog = console.log;
|
|
5445
|
-
prevInfo = console.info;
|
|
5446
|
-
prevWarn = console.warn;
|
|
5447
|
-
prevError = console.error;
|
|
5448
|
-
prevGroup = console.group;
|
|
5449
|
-
prevGroupCollapsed = console.groupCollapsed;
|
|
5450
|
-
prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099
|
|
5554
|
+
return describeComponentFrame(name, source, ownerName);
|
|
5555
|
+
}
|
|
5556
|
+
}
|
|
5557
|
+
var componentFrameCache;
|
|
5451
5558
|
|
|
5452
|
-
|
|
5453
|
-
|
|
5454
|
-
|
|
5455
|
-
|
|
5456
|
-
|
|
5457
|
-
}; // $FlowFixMe Flow thinks console is immutable.
|
|
5559
|
+
{
|
|
5560
|
+
var PossiblyWeakMap = typeof WeakMap === "function" ? WeakMap : Map;
|
|
5561
|
+
componentFrameCache = new PossiblyWeakMap();
|
|
5562
|
+
}
|
|
5563
|
+
var BEFORE_SLASH_RE = /^(.*)[\\\/]/;
|
|
5458
5564
|
|
|
5459
|
-
|
|
5460
|
-
|
|
5461
|
-
|
|
5462
|
-
|
|
5463
|
-
|
|
5464
|
-
|
|
5465
|
-
|
|
5466
|
-
|
|
5467
|
-
|
|
5468
|
-
|
|
5565
|
+
function describeComponentFrame(name, source, ownerName) {
|
|
5566
|
+
var sourceInfo = "";
|
|
5567
|
+
|
|
5568
|
+
if (source) {
|
|
5569
|
+
var path = source.fileName;
|
|
5570
|
+
var fileName = path.replace(BEFORE_SLASH_RE, ""); // In DEV, include code for a common special case:
|
|
5571
|
+
// prefer "folder/index.js" instead of just "index.js".
|
|
5572
|
+
|
|
5573
|
+
if (/^index\./.test(fileName)) {
|
|
5574
|
+
var match = path.match(BEFORE_SLASH_RE);
|
|
5575
|
+
|
|
5576
|
+
if (match) {
|
|
5577
|
+
var pathBeforeSlash = match[1];
|
|
5578
|
+
|
|
5579
|
+
if (pathBeforeSlash) {
|
|
5580
|
+
var folderName = pathBeforeSlash.replace(BEFORE_SLASH_RE, "");
|
|
5581
|
+
fileName = folderName + "/" + fileName;
|
|
5582
|
+
}
|
|
5583
|
+
}
|
|
5469
5584
|
}
|
|
5470
5585
|
|
|
5471
|
-
|
|
5586
|
+
sourceInfo = " (at " + fileName + ":" + source.lineNumber + ")";
|
|
5587
|
+
} else if (ownerName) {
|
|
5588
|
+
sourceInfo = " (created by " + ownerName + ")";
|
|
5472
5589
|
}
|
|
5473
|
-
|
|
5474
|
-
|
|
5475
|
-
{
|
|
5476
|
-
disabledDepth--;
|
|
5477
|
-
|
|
5478
|
-
if (disabledDepth === 0) {
|
|
5479
|
-
/* eslint-disable react-internal/no-production-logging */
|
|
5480
|
-
var props = {
|
|
5481
|
-
configurable: true,
|
|
5482
|
-
enumerable: true,
|
|
5483
|
-
writable: true
|
|
5484
|
-
}; // $FlowFixMe Flow thinks console is immutable.
|
|
5485
|
-
|
|
5486
|
-
Object.defineProperties(console, {
|
|
5487
|
-
log: Object.assign({}, props, {
|
|
5488
|
-
value: prevLog
|
|
5489
|
-
}),
|
|
5490
|
-
info: Object.assign({}, props, {
|
|
5491
|
-
value: prevInfo
|
|
5492
|
-
}),
|
|
5493
|
-
warn: Object.assign({}, props, {
|
|
5494
|
-
value: prevWarn
|
|
5495
|
-
}),
|
|
5496
|
-
error: Object.assign({}, props, {
|
|
5497
|
-
value: prevError
|
|
5498
|
-
}),
|
|
5499
|
-
group: Object.assign({}, props, {
|
|
5500
|
-
value: prevGroup
|
|
5501
|
-
}),
|
|
5502
|
-
groupCollapsed: Object.assign({}, props, {
|
|
5503
|
-
value: prevGroupCollapsed
|
|
5504
|
-
}),
|
|
5505
|
-
groupEnd: Object.assign({}, props, {
|
|
5506
|
-
value: prevGroupEnd
|
|
5507
|
-
})
|
|
5508
|
-
});
|
|
5509
|
-
/* eslint-enable react-internal/no-production-logging */
|
|
5510
|
-
}
|
|
5511
|
-
|
|
5512
|
-
if (disabledDepth < 0) {
|
|
5513
|
-
error(
|
|
5514
|
-
"disabledDepth fell below zero. " +
|
|
5515
|
-
"This is a bug in React. Please file an issue."
|
|
5516
|
-
);
|
|
5517
|
-
}
|
|
5518
|
-
}
|
|
5519
|
-
}
|
|
5520
|
-
|
|
5521
|
-
var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
|
|
5522
|
-
function describeBuiltInComponentFrame(name, source, ownerFn) {
|
|
5523
|
-
{
|
|
5524
|
-
var ownerName = null;
|
|
5525
|
-
|
|
5526
|
-
if (ownerFn) {
|
|
5527
|
-
ownerName = ownerFn.displayName || ownerFn.name || null;
|
|
5528
|
-
}
|
|
5529
|
-
|
|
5530
|
-
return describeComponentFrame(name, source, ownerName);
|
|
5531
|
-
}
|
|
5532
|
-
}
|
|
5533
|
-
var componentFrameCache;
|
|
5534
|
-
|
|
5535
|
-
{
|
|
5536
|
-
var PossiblyWeakMap = typeof WeakMap === "function" ? WeakMap : Map;
|
|
5537
|
-
componentFrameCache = new PossiblyWeakMap();
|
|
5538
|
-
}
|
|
5539
|
-
var BEFORE_SLASH_RE = /^(.*)[\\\/]/;
|
|
5540
|
-
|
|
5541
|
-
function describeComponentFrame(name, source, ownerName) {
|
|
5542
|
-
var sourceInfo = "";
|
|
5543
|
-
|
|
5544
|
-
if (source) {
|
|
5545
|
-
var path = source.fileName;
|
|
5546
|
-
var fileName = path.replace(BEFORE_SLASH_RE, ""); // In DEV, include code for a common special case:
|
|
5547
|
-
// prefer "folder/index.js" instead of just "index.js".
|
|
5548
|
-
|
|
5549
|
-
if (/^index\./.test(fileName)) {
|
|
5550
|
-
var match = path.match(BEFORE_SLASH_RE);
|
|
5551
|
-
|
|
5552
|
-
if (match) {
|
|
5553
|
-
var pathBeforeSlash = match[1];
|
|
5554
|
-
|
|
5555
|
-
if (pathBeforeSlash) {
|
|
5556
|
-
var folderName = pathBeforeSlash.replace(BEFORE_SLASH_RE, "");
|
|
5557
|
-
fileName = folderName + "/" + fileName;
|
|
5558
|
-
}
|
|
5559
|
-
}
|
|
5560
|
-
}
|
|
5561
|
-
|
|
5562
|
-
sourceInfo = " (at " + fileName + ":" + source.lineNumber + ")";
|
|
5563
|
-
} else if (ownerName) {
|
|
5564
|
-
sourceInfo = " (created by " + ownerName + ")";
|
|
5565
|
-
}
|
|
5566
|
-
|
|
5567
|
-
return "\n in " + (name || "Unknown") + sourceInfo;
|
|
5590
|
+
|
|
5591
|
+
return "\n in " + (name || "Unknown") + sourceInfo;
|
|
5568
5592
|
}
|
|
5569
5593
|
|
|
5570
5594
|
function describeClassComponentFrame(ctor, source, ownerFn) {
|
|
@@ -5677,6 +5701,7 @@ function checkPropTypes(typeSpecs, values, location, componentName, element) {
|
|
|
5677
5701
|
// This is intentionally an invariant that gets caught. It's the same
|
|
5678
5702
|
// behavior as without this statement except with a better message.
|
|
5679
5703
|
if (typeof typeSpecs[typeSpecName] !== "function") {
|
|
5704
|
+
// eslint-disable-next-line react-internal/prod-error-codes
|
|
5680
5705
|
var err = Error(
|
|
5681
5706
|
(componentName || "React class") +
|
|
5682
5707
|
": " +
|
|
@@ -5908,9 +5933,10 @@ function popTopLevelContextObject(fiber) {
|
|
|
5908
5933
|
|
|
5909
5934
|
function pushTopLevelContextObject(fiber, context, didChange) {
|
|
5910
5935
|
{
|
|
5911
|
-
if (
|
|
5912
|
-
throw Error(
|
|
5913
|
-
"Unexpected context found on stack.
|
|
5936
|
+
if (contextStackCursor.current !== emptyContextObject) {
|
|
5937
|
+
throw new Error(
|
|
5938
|
+
"Unexpected context found on stack. " +
|
|
5939
|
+
"This error is likely caused by a bug in React. Please file an issue."
|
|
5914
5940
|
);
|
|
5915
5941
|
}
|
|
5916
5942
|
|
|
@@ -5949,7 +5975,7 @@ function processChildContext(fiber, type, parentContext) {
|
|
|
5949
5975
|
|
|
5950
5976
|
for (var contextKey in childContext) {
|
|
5951
5977
|
if (!(contextKey in childContextTypes)) {
|
|
5952
|
-
throw Error(
|
|
5978
|
+
throw new Error(
|
|
5953
5979
|
(getComponentNameFromFiber(fiber) || "Unknown") +
|
|
5954
5980
|
'.getChildContext(): key "' +
|
|
5955
5981
|
contextKey +
|
|
@@ -5994,8 +6020,9 @@ function invalidateContextProvider(workInProgress, type, didChange) {
|
|
|
5994
6020
|
var instance = workInProgress.stateNode;
|
|
5995
6021
|
|
|
5996
6022
|
if (!instance) {
|
|
5997
|
-
throw Error(
|
|
5998
|
-
"Expected to have an instance by this point.
|
|
6023
|
+
throw new Error(
|
|
6024
|
+
"Expected to have an instance by this point. " +
|
|
6025
|
+
"This error is likely caused by a bug in React. Please file an issue."
|
|
5999
6026
|
);
|
|
6000
6027
|
}
|
|
6001
6028
|
|
|
@@ -6027,9 +6054,10 @@ function findCurrentUnmaskedContext(fiber) {
|
|
|
6027
6054
|
{
|
|
6028
6055
|
// Currently this is only used with renderSubtreeIntoContainer; not sure if it
|
|
6029
6056
|
// makes sense elsewhere
|
|
6030
|
-
if (!
|
|
6031
|
-
throw Error(
|
|
6032
|
-
"Expected subtree parent to be a mounted class component.
|
|
6057
|
+
if (!isFiberMounted(fiber) || fiber.tag !== ClassComponent) {
|
|
6058
|
+
throw new Error(
|
|
6059
|
+
"Expected subtree parent to be a mounted class component. " +
|
|
6060
|
+
"This error is likely caused by a bug in React. Please file an issue."
|
|
6033
6061
|
);
|
|
6034
6062
|
}
|
|
6035
6063
|
|
|
@@ -6054,17 +6082,28 @@ function findCurrentUnmaskedContext(fiber) {
|
|
|
6054
6082
|
node = node.return;
|
|
6055
6083
|
} while (node !== null);
|
|
6056
6084
|
|
|
6057
|
-
|
|
6058
|
-
|
|
6059
|
-
"
|
|
6060
|
-
|
|
6061
|
-
}
|
|
6085
|
+
throw new Error(
|
|
6086
|
+
"Found unexpected detached subtree parent. " +
|
|
6087
|
+
"This error is likely caused by a bug in React. Please file an issue."
|
|
6088
|
+
);
|
|
6062
6089
|
}
|
|
6063
6090
|
}
|
|
6064
6091
|
|
|
6065
6092
|
var LegacyRoot = 0;
|
|
6066
6093
|
var ConcurrentRoot = 1;
|
|
6067
6094
|
|
|
6095
|
+
/**
|
|
6096
|
+
* inlined Object.is polyfill to avoid requiring consumers ship their own
|
|
6097
|
+
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
|
|
6098
|
+
*/
|
|
6099
|
+
function is(x, y) {
|
|
6100
|
+
return (
|
|
6101
|
+
(x === y && (x !== 0 || 1 / x === 1 / y)) || (x !== x && y !== y) // eslint-disable-line no-self-compare
|
|
6102
|
+
);
|
|
6103
|
+
}
|
|
6104
|
+
|
|
6105
|
+
var objectIs = typeof Object.is === "function" ? Object.is : is;
|
|
6106
|
+
|
|
6068
6107
|
var syncQueue = null;
|
|
6069
6108
|
var includesLegacySyncCallbacks = false;
|
|
6070
6109
|
var isFlushingSyncQueue = false;
|
|
@@ -6134,7 +6173,12 @@ function flushSyncCallbacks() {
|
|
|
6134
6173
|
return null;
|
|
6135
6174
|
}
|
|
6136
6175
|
|
|
6137
|
-
var ReactVersion = "18.0.0-
|
|
6176
|
+
var ReactVersion = "18.0.0-afcb9cdc9-20211008";
|
|
6177
|
+
|
|
6178
|
+
function markComponentRenderStopped() {}
|
|
6179
|
+
function markComponentErrored(fiber, thrownValue, lanes) {}
|
|
6180
|
+
|
|
6181
|
+
function markComponentSuspended(fiber, wakeable, lanes) {}
|
|
6138
6182
|
|
|
6139
6183
|
var ReactCurrentBatchConfig = ReactSharedInternals.ReactCurrentBatchConfig;
|
|
6140
6184
|
var NoTransition = 0;
|
|
@@ -6142,18 +6186,6 @@ function requestCurrentTransition() {
|
|
|
6142
6186
|
return ReactCurrentBatchConfig.transition;
|
|
6143
6187
|
}
|
|
6144
6188
|
|
|
6145
|
-
/**
|
|
6146
|
-
* inlined Object.is polyfill to avoid requiring consumers ship their own
|
|
6147
|
-
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
|
|
6148
|
-
*/
|
|
6149
|
-
function is(x, y) {
|
|
6150
|
-
return (
|
|
6151
|
-
(x === y && (x !== 0 || 1 / x === 1 / y)) || (x !== x && y !== y) // eslint-disable-line no-self-compare
|
|
6152
|
-
);
|
|
6153
|
-
}
|
|
6154
|
-
|
|
6155
|
-
var objectIs = typeof Object.is === "function" ? Object.is : is;
|
|
6156
|
-
|
|
6157
6189
|
/**
|
|
6158
6190
|
* Performs equality by iterating through keys on an object and returning false
|
|
6159
6191
|
* when any key has values which are not strictly equal between the arguments.
|
|
@@ -6645,6 +6677,105 @@ var ReactStrictModeWarnings = {
|
|
|
6645
6677
|
};
|
|
6646
6678
|
}
|
|
6647
6679
|
|
|
6680
|
+
/*
|
|
6681
|
+
* The `'' + value` pattern (used in in perf-sensitive code) throws for Symbol
|
|
6682
|
+
* and Temporal.* types. See https://github.com/facebook/react/pull/22064.
|
|
6683
|
+
*
|
|
6684
|
+
* The functions in this module will throw an easier-to-understand,
|
|
6685
|
+
* easier-to-debug exception with a clear errors message message explaining the
|
|
6686
|
+
* problem. (Instead of a confusing exception thrown inside the implementation
|
|
6687
|
+
* of the `value` object).
|
|
6688
|
+
*/
|
|
6689
|
+
// $FlowFixMe only called in DEV, so void return is not possible.
|
|
6690
|
+
|
|
6691
|
+
function typeName(value) {
|
|
6692
|
+
{
|
|
6693
|
+
// toStringTag is needed for namespaced types like Temporal.Instant
|
|
6694
|
+
var hasToStringTag = typeof Symbol === "function" && Symbol.toStringTag;
|
|
6695
|
+
var type =
|
|
6696
|
+
(hasToStringTag && value[Symbol.toStringTag]) ||
|
|
6697
|
+
value.constructor.name ||
|
|
6698
|
+
"Object";
|
|
6699
|
+
return type;
|
|
6700
|
+
}
|
|
6701
|
+
} // $FlowFixMe only called in DEV, so void return is not possible.
|
|
6702
|
+
|
|
6703
|
+
function willCoercionThrow(value) {
|
|
6704
|
+
{
|
|
6705
|
+
if (
|
|
6706
|
+
value !== null &&
|
|
6707
|
+
typeof value === "object" &&
|
|
6708
|
+
value.$$typeof === REACT_OPAQUE_ID_TYPE
|
|
6709
|
+
) {
|
|
6710
|
+
// OpaqueID type is expected to throw, so React will handle it. Not sure if
|
|
6711
|
+
// it's expected that string coercion will throw, but we'll assume it's OK.
|
|
6712
|
+
// See https://github.com/facebook/react/issues/20127.
|
|
6713
|
+
return;
|
|
6714
|
+
}
|
|
6715
|
+
|
|
6716
|
+
try {
|
|
6717
|
+
testStringCoercion(value);
|
|
6718
|
+
return false;
|
|
6719
|
+
} catch (e) {
|
|
6720
|
+
return true;
|
|
6721
|
+
}
|
|
6722
|
+
}
|
|
6723
|
+
}
|
|
6724
|
+
|
|
6725
|
+
function testStringCoercion(value) {
|
|
6726
|
+
// If you ended up here by following an exception call stack, here's what's
|
|
6727
|
+
// happened: you supplied an object or symbol value to React (as a prop, key,
|
|
6728
|
+
// DOM attribute, CSS property, string ref, etc.) and when React tried to
|
|
6729
|
+
// coerce it to a string using `'' + value`, an exception was thrown.
|
|
6730
|
+
//
|
|
6731
|
+
// The most common types that will cause this exception are `Symbol` instances
|
|
6732
|
+
// and Temporal objects like `Temporal.Instant`. But any object that has a
|
|
6733
|
+
// `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this
|
|
6734
|
+
// exception. (Library authors do this to prevent users from using built-in
|
|
6735
|
+
// numeric operators like `+` or comparison operators like `>=` because custom
|
|
6736
|
+
// methods are needed to perform accurate arithmetic or comparison.)
|
|
6737
|
+
//
|
|
6738
|
+
// To fix the problem, coerce this object or symbol value to a string before
|
|
6739
|
+
// passing it to React. The most reliable way is usually `String(value)`.
|
|
6740
|
+
//
|
|
6741
|
+
// To find which value is throwing, check the browser or debugger console.
|
|
6742
|
+
// Before this exception was thrown, there should be `console.error` output
|
|
6743
|
+
// that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the
|
|
6744
|
+
// problem and how that type was used: key, atrribute, input value prop, etc.
|
|
6745
|
+
// In most cases, this console output also shows the component and its
|
|
6746
|
+
// ancestor components where the exception happened.
|
|
6747
|
+
//
|
|
6748
|
+
// eslint-disable-next-line react-internal/safe-string-coercion
|
|
6749
|
+
return "" + value;
|
|
6750
|
+
}
|
|
6751
|
+
function checkKeyStringCoercion(value) {
|
|
6752
|
+
{
|
|
6753
|
+
if (willCoercionThrow(value)) {
|
|
6754
|
+
error(
|
|
6755
|
+
"The provided key is an unsupported type %s." +
|
|
6756
|
+
" This value must be coerced to a string before before using it here.",
|
|
6757
|
+
typeName(value)
|
|
6758
|
+
);
|
|
6759
|
+
|
|
6760
|
+
return testStringCoercion(value); // throw (to help callers find troubleshooting comments)
|
|
6761
|
+
}
|
|
6762
|
+
}
|
|
6763
|
+
}
|
|
6764
|
+
function checkPropStringCoercion(value, propName) {
|
|
6765
|
+
{
|
|
6766
|
+
if (willCoercionThrow(value)) {
|
|
6767
|
+
error(
|
|
6768
|
+
"The provided `%s` prop is an unsupported type %s." +
|
|
6769
|
+
" This value must be coerced to a string before before using it here.",
|
|
6770
|
+
propName,
|
|
6771
|
+
typeName(value)
|
|
6772
|
+
);
|
|
6773
|
+
|
|
6774
|
+
return testStringCoercion(value); // throw (to help callers find troubleshooting comments)
|
|
6775
|
+
}
|
|
6776
|
+
}
|
|
6777
|
+
}
|
|
6778
|
+
|
|
6648
6779
|
function resolveDefaultProps(Component, baseProps) {
|
|
6649
6780
|
if (Component && Component.defaultProps) {
|
|
6650
6781
|
// Resolve default props. Taken from ReactElement
|
|
@@ -6909,9 +7040,12 @@ function readContext(context) {
|
|
|
6909
7040
|
};
|
|
6910
7041
|
|
|
6911
7042
|
if (lastContextDependency === null) {
|
|
6912
|
-
if (
|
|
6913
|
-
throw Error(
|
|
6914
|
-
"Context can only be read while React is rendering.
|
|
7043
|
+
if (currentlyRenderingFiber === null) {
|
|
7044
|
+
throw new Error(
|
|
7045
|
+
"Context can only be read while React is rendering. " +
|
|
7046
|
+
"In classes, you can read it in the render method or getDerivedStateFromProps. " +
|
|
7047
|
+
"In function components, you can read it directly in the function body, but not " +
|
|
7048
|
+
"inside Hooks like useReducer() or useMemo()."
|
|
6915
7049
|
);
|
|
6916
7050
|
} // This is the first dependency for this component. Create a new list.
|
|
6917
7051
|
|
|
@@ -7212,12 +7346,12 @@ function getStateFromUpdate(
|
|
|
7212
7346
|
|
|
7213
7347
|
{
|
|
7214
7348
|
if (workInProgress.mode & StrictLegacyMode) {
|
|
7215
|
-
|
|
7349
|
+
setIsStrictModeForDevtools(true);
|
|
7216
7350
|
|
|
7217
7351
|
try {
|
|
7218
7352
|
payload.call(instance, prevState, nextProps);
|
|
7219
7353
|
} finally {
|
|
7220
|
-
|
|
7354
|
+
setIsStrictModeForDevtools(false);
|
|
7221
7355
|
}
|
|
7222
7356
|
}
|
|
7223
7357
|
|
|
@@ -7250,12 +7384,12 @@ function getStateFromUpdate(
|
|
|
7250
7384
|
|
|
7251
7385
|
{
|
|
7252
7386
|
if (workInProgress.mode & StrictLegacyMode) {
|
|
7253
|
-
|
|
7387
|
+
setIsStrictModeForDevtools(true);
|
|
7254
7388
|
|
|
7255
7389
|
try {
|
|
7256
7390
|
_payload.call(instance, prevState, nextProps);
|
|
7257
7391
|
} finally {
|
|
7258
|
-
|
|
7392
|
+
setIsStrictModeForDevtools(false);
|
|
7259
7393
|
}
|
|
7260
7394
|
}
|
|
7261
7395
|
|
|
@@ -7479,10 +7613,10 @@ function processUpdateQueue(workInProgress, props, instance, renderLanes) {
|
|
|
7479
7613
|
}
|
|
7480
7614
|
|
|
7481
7615
|
function callCallback(callback, context) {
|
|
7482
|
-
if (
|
|
7483
|
-
throw Error(
|
|
7484
|
-
"Invalid argument passed as callback. Expected a function. Instead
|
|
7485
|
-
callback
|
|
7616
|
+
if (typeof callback !== "function") {
|
|
7617
|
+
throw new Error(
|
|
7618
|
+
"Invalid argument passed as callback. Expected a function. Instead " +
|
|
7619
|
+
("received: " + callback)
|
|
7486
7620
|
);
|
|
7487
7621
|
}
|
|
7488
7622
|
|
|
@@ -7581,11 +7715,14 @@ var didWarnAboutInvalidateContextType;
|
|
|
7581
7715
|
Object.defineProperty(fakeInternalInstance, "_processChildContext", {
|
|
7582
7716
|
enumerable: false,
|
|
7583
7717
|
value: function() {
|
|
7584
|
-
|
|
7585
|
-
|
|
7586
|
-
"
|
|
7587
|
-
|
|
7588
|
-
|
|
7718
|
+
throw new Error(
|
|
7719
|
+
"_processChildContext is not available in React 16+. This likely " +
|
|
7720
|
+
"means you have multiple copies of React and are attempting to nest " +
|
|
7721
|
+
"a React 15 tree inside a React 16 tree using " +
|
|
7722
|
+
"unstable_renderSubtreeIntoContainer, which isn't supported. Try " +
|
|
7723
|
+
"to make sure you have only one copy of React (and ideally, switch " +
|
|
7724
|
+
"to ReactDOM.createPortal)."
|
|
7725
|
+
);
|
|
7589
7726
|
}
|
|
7590
7727
|
});
|
|
7591
7728
|
Object.freeze(fakeInternalInstance);
|
|
@@ -7602,13 +7739,13 @@ function applyDerivedStateFromProps(
|
|
|
7602
7739
|
|
|
7603
7740
|
{
|
|
7604
7741
|
if (workInProgress.mode & StrictLegacyMode) {
|
|
7605
|
-
|
|
7742
|
+
setIsStrictModeForDevtools(true);
|
|
7606
7743
|
|
|
7607
7744
|
try {
|
|
7608
7745
|
// Invoke the function an extra time to help detect side-effects.
|
|
7609
7746
|
partialState = getDerivedStateFromProps(nextProps, prevState);
|
|
7610
7747
|
} finally {
|
|
7611
|
-
|
|
7748
|
+
setIsStrictModeForDevtools(false);
|
|
7612
7749
|
}
|
|
7613
7750
|
}
|
|
7614
7751
|
|
|
@@ -7720,7 +7857,7 @@ function checkShouldComponentUpdate(
|
|
|
7720
7857
|
|
|
7721
7858
|
{
|
|
7722
7859
|
if (workInProgress.mode & StrictLegacyMode) {
|
|
7723
|
-
|
|
7860
|
+
setIsStrictModeForDevtools(true);
|
|
7724
7861
|
|
|
7725
7862
|
try {
|
|
7726
7863
|
// Invoke the function an extra time to help detect side-effects.
|
|
@@ -7730,7 +7867,7 @@ function checkShouldComponentUpdate(
|
|
|
7730
7867
|
nextContext
|
|
7731
7868
|
);
|
|
7732
7869
|
} finally {
|
|
7733
|
-
|
|
7870
|
+
setIsStrictModeForDevtools(false);
|
|
7734
7871
|
}
|
|
7735
7872
|
}
|
|
7736
7873
|
|
|
@@ -8054,12 +8191,12 @@ function constructClassInstance(workInProgress, ctor, props) {
|
|
|
8054
8191
|
|
|
8055
8192
|
{
|
|
8056
8193
|
if (workInProgress.mode & StrictLegacyMode) {
|
|
8057
|
-
|
|
8194
|
+
setIsStrictModeForDevtools(true);
|
|
8058
8195
|
|
|
8059
8196
|
try {
|
|
8060
8197
|
instance = new ctor(props, context); // eslint-disable-line no-new
|
|
8061
8198
|
} finally {
|
|
8062
|
-
|
|
8199
|
+
setIsStrictModeForDevtools(false);
|
|
8063
8200
|
}
|
|
8064
8201
|
}
|
|
8065
8202
|
}
|
|
@@ -8665,9 +8802,10 @@ var warnForMissingKey = function(child, returnFiber) {};
|
|
|
8665
8802
|
return;
|
|
8666
8803
|
}
|
|
8667
8804
|
|
|
8668
|
-
if (
|
|
8669
|
-
throw Error(
|
|
8670
|
-
"React Component in warnForMissingKey should have a _store.
|
|
8805
|
+
if (typeof child._store !== "object") {
|
|
8806
|
+
throw new Error(
|
|
8807
|
+
"React Component in warnForMissingKey should have a _store. " +
|
|
8808
|
+
"This error is likely caused by a bug in React. Please file an issue."
|
|
8671
8809
|
);
|
|
8672
8810
|
}
|
|
8673
8811
|
|
|
@@ -8736,9 +8874,12 @@ function coerceRef(returnFiber, current, element) {
|
|
|
8736
8874
|
if (owner) {
|
|
8737
8875
|
var ownerFiber = owner;
|
|
8738
8876
|
|
|
8739
|
-
if (
|
|
8740
|
-
throw Error(
|
|
8741
|
-
"Function components cannot have string refs.
|
|
8877
|
+
if (ownerFiber.tag !== ClassComponent) {
|
|
8878
|
+
throw new Error(
|
|
8879
|
+
"Function components cannot have string refs. " +
|
|
8880
|
+
"We recommend using useRef() instead. " +
|
|
8881
|
+
"Learn more about using refs safely here: " +
|
|
8882
|
+
"https://reactjs.org/link/strict-mode-string-ref"
|
|
8742
8883
|
);
|
|
8743
8884
|
}
|
|
8744
8885
|
|
|
@@ -8746,11 +8887,18 @@ function coerceRef(returnFiber, current, element) {
|
|
|
8746
8887
|
}
|
|
8747
8888
|
|
|
8748
8889
|
if (!inst) {
|
|
8749
|
-
throw Error(
|
|
8890
|
+
throw new Error(
|
|
8750
8891
|
"Missing owner for string ref " +
|
|
8751
8892
|
mixedRef +
|
|
8752
|
-
". This error is likely caused by a
|
|
8893
|
+
". This error is likely caused by a " +
|
|
8894
|
+
"bug in React. Please file an issue."
|
|
8753
8895
|
);
|
|
8896
|
+
} // Assigning this to a const so Flow knows it won't change in the closure
|
|
8897
|
+
|
|
8898
|
+
var resolvedInst = inst;
|
|
8899
|
+
|
|
8900
|
+
{
|
|
8901
|
+
checkPropStringCoercion(mixedRef, "ref");
|
|
8754
8902
|
}
|
|
8755
8903
|
|
|
8756
8904
|
var stringRef = "" + mixedRef; // Check if previous string ref matches new string ref
|
|
@@ -8765,11 +8913,11 @@ function coerceRef(returnFiber, current, element) {
|
|
|
8765
8913
|
}
|
|
8766
8914
|
|
|
8767
8915
|
var ref = function(value) {
|
|
8768
|
-
var refs =
|
|
8916
|
+
var refs = resolvedInst.refs;
|
|
8769
8917
|
|
|
8770
8918
|
if (refs === emptyRefsObject) {
|
|
8771
8919
|
// This is a lazy pooled frozen object, so we need to initialize.
|
|
8772
|
-
refs =
|
|
8920
|
+
refs = resolvedInst.refs = {};
|
|
8773
8921
|
}
|
|
8774
8922
|
|
|
8775
8923
|
if (value === null) {
|
|
@@ -8782,17 +8930,22 @@ function coerceRef(returnFiber, current, element) {
|
|
|
8782
8930
|
ref._stringRef = stringRef;
|
|
8783
8931
|
return ref;
|
|
8784
8932
|
} else {
|
|
8785
|
-
if (
|
|
8786
|
-
throw Error(
|
|
8933
|
+
if (typeof mixedRef !== "string") {
|
|
8934
|
+
throw new Error(
|
|
8787
8935
|
"Expected ref to be a function, a string, an object returned by React.createRef(), or null."
|
|
8788
8936
|
);
|
|
8789
8937
|
}
|
|
8790
8938
|
|
|
8791
8939
|
if (!element._owner) {
|
|
8792
|
-
throw Error(
|
|
8940
|
+
throw new Error(
|
|
8793
8941
|
"Element ref was specified as a string (" +
|
|
8794
8942
|
mixedRef +
|
|
8795
|
-
") but no owner was set. This could happen for one of
|
|
8943
|
+
") but no owner was set. This could happen for one of" +
|
|
8944
|
+
" the following reasons:\n" +
|
|
8945
|
+
"1. You may be adding a ref to a function component\n" +
|
|
8946
|
+
"2. You may be adding a ref to a component that was not created inside a component's render method\n" +
|
|
8947
|
+
"3. You have multiple copies of React loaded\n" +
|
|
8948
|
+
"See https://reactjs.org/link/refs-must-have-owner for more information."
|
|
8796
8949
|
);
|
|
8797
8950
|
}
|
|
8798
8951
|
}
|
|
@@ -8803,16 +8956,15 @@ function coerceRef(returnFiber, current, element) {
|
|
|
8803
8956
|
|
|
8804
8957
|
function throwOnInvalidObjectType(returnFiber, newChild) {
|
|
8805
8958
|
var childString = Object.prototype.toString.call(newChild);
|
|
8806
|
-
|
|
8807
|
-
|
|
8808
|
-
|
|
8809
|
-
|
|
8810
|
-
|
|
8811
|
-
|
|
8812
|
-
|
|
8813
|
-
|
|
8814
|
-
|
|
8815
|
-
}
|
|
8959
|
+
throw new Error(
|
|
8960
|
+
"Objects are not valid as a React child (found: " +
|
|
8961
|
+
(childString === "[object Object]"
|
|
8962
|
+
? "object with keys {" + Object.keys(newChild).join(", ") + "}"
|
|
8963
|
+
: childString) +
|
|
8964
|
+
"). " +
|
|
8965
|
+
"If you meant to render a collection of children, use an array " +
|
|
8966
|
+
"instead."
|
|
8967
|
+
);
|
|
8816
8968
|
}
|
|
8817
8969
|
|
|
8818
8970
|
function warnOnFunctionType(returnFiber) {
|
|
@@ -9428,9 +9580,10 @@ function ChildReconciler(shouldTrackSideEffects) {
|
|
|
9428
9580
|
// but using the iterator instead.
|
|
9429
9581
|
var iteratorFn = getIteratorFn(newChildrenIterable);
|
|
9430
9582
|
|
|
9431
|
-
if (
|
|
9432
|
-
throw Error(
|
|
9433
|
-
"An object is not an iterable. This error is likely caused by a bug in
|
|
9583
|
+
if (typeof iteratorFn !== "function") {
|
|
9584
|
+
throw new Error(
|
|
9585
|
+
"An object is not an iterable. This error is likely caused by a bug in " +
|
|
9586
|
+
"React. Please file an issue."
|
|
9434
9587
|
);
|
|
9435
9588
|
}
|
|
9436
9589
|
|
|
@@ -9482,8 +9635,8 @@ function ChildReconciler(shouldTrackSideEffects) {
|
|
|
9482
9635
|
|
|
9483
9636
|
var newChildren = iteratorFn.call(newChildrenIterable);
|
|
9484
9637
|
|
|
9485
|
-
if (
|
|
9486
|
-
throw Error("An iterable object provided no iterator.");
|
|
9638
|
+
if (newChildren == null) {
|
|
9639
|
+
throw new Error("An iterable object provided no iterator.");
|
|
9487
9640
|
}
|
|
9488
9641
|
|
|
9489
9642
|
var resultingFirstChild = null;
|
|
@@ -9860,8 +10013,8 @@ function ChildReconciler(shouldTrackSideEffects) {
|
|
|
9860
10013
|
var reconcileChildFibers = ChildReconciler(true);
|
|
9861
10014
|
var mountChildFibers = ChildReconciler(false);
|
|
9862
10015
|
function cloneChildFibers(current, workInProgress) {
|
|
9863
|
-
if (
|
|
9864
|
-
throw Error("Resuming work not yet implemented.");
|
|
10016
|
+
if (current !== null && workInProgress.child !== current.child) {
|
|
10017
|
+
throw new Error("Resuming work not yet implemented.");
|
|
9865
10018
|
}
|
|
9866
10019
|
|
|
9867
10020
|
if (workInProgress.child === null) {
|
|
@@ -9900,9 +10053,10 @@ var contextFiberStackCursor = createCursor(NO_CONTEXT);
|
|
|
9900
10053
|
var rootInstanceStackCursor = createCursor(NO_CONTEXT);
|
|
9901
10054
|
|
|
9902
10055
|
function requiredContext(c) {
|
|
9903
|
-
if (
|
|
9904
|
-
throw Error(
|
|
9905
|
-
"Expected host context to exist. This error is likely caused by a bug
|
|
10056
|
+
if (c === NO_CONTEXT) {
|
|
10057
|
+
throw new Error(
|
|
10058
|
+
"Expected host context to exist. This error is likely caused by a bug " +
|
|
10059
|
+
"in React. Please file an issue."
|
|
9906
10060
|
);
|
|
9907
10061
|
}
|
|
9908
10062
|
|
|
@@ -10088,19 +10242,22 @@ function findFirstSuspended(row) {
|
|
|
10088
10242
|
}
|
|
10089
10243
|
|
|
10090
10244
|
var NoFlags$1 =
|
|
10091
|
-
/*
|
|
10245
|
+
/* */
|
|
10092
10246
|
0; // Represents whether effect should fire.
|
|
10093
10247
|
|
|
10094
10248
|
var HasEffect =
|
|
10095
10249
|
/* */
|
|
10096
10250
|
1; // Represents the phase in which the effect (not the clean-up) fires.
|
|
10097
10251
|
|
|
10252
|
+
var Insertion =
|
|
10253
|
+
/* */
|
|
10254
|
+
2;
|
|
10098
10255
|
var Layout =
|
|
10099
10256
|
/* */
|
|
10100
|
-
|
|
10257
|
+
4;
|
|
10101
10258
|
var Passive$1 =
|
|
10102
10259
|
/* */
|
|
10103
|
-
|
|
10260
|
+
8;
|
|
10104
10261
|
|
|
10105
10262
|
var isHydrating = false;
|
|
10106
10263
|
|
|
@@ -10116,21 +10273,19 @@ function prepareToHydrateHostInstance(
|
|
|
10116
10273
|
hostContext
|
|
10117
10274
|
) {
|
|
10118
10275
|
{
|
|
10119
|
-
|
|
10120
|
-
|
|
10121
|
-
"
|
|
10122
|
-
|
|
10123
|
-
}
|
|
10276
|
+
throw new Error(
|
|
10277
|
+
"Expected prepareToHydrateHostInstance() to never be called. " +
|
|
10278
|
+
"This error is likely caused by a bug in React. Please file an issue."
|
|
10279
|
+
);
|
|
10124
10280
|
}
|
|
10125
10281
|
}
|
|
10126
10282
|
|
|
10127
10283
|
function prepareToHydrateHostTextInstance(fiber) {
|
|
10128
10284
|
{
|
|
10129
|
-
|
|
10130
|
-
|
|
10131
|
-
"
|
|
10132
|
-
|
|
10133
|
-
}
|
|
10285
|
+
throw new Error(
|
|
10286
|
+
"Expected prepareToHydrateHostTextInstance() to never be called. " +
|
|
10287
|
+
"This error is likely caused by a bug in React. Please file an issue."
|
|
10288
|
+
);
|
|
10134
10289
|
}
|
|
10135
10290
|
var shouldUpdate = hydrateTextInstance();
|
|
10136
10291
|
}
|
|
@@ -10207,6 +10362,7 @@ var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher,
|
|
|
10207
10362
|
ReactCurrentBatchConfig$1 = ReactSharedInternals.ReactCurrentBatchConfig;
|
|
10208
10363
|
var didWarnAboutMismatchedHooksForComponent;
|
|
10209
10364
|
var didWarnAboutUseOpaqueIdentifier;
|
|
10365
|
+
var didWarnUncachedGetSnapshot;
|
|
10210
10366
|
|
|
10211
10367
|
{
|
|
10212
10368
|
didWarnAboutUseOpaqueIdentifier = {};
|
|
@@ -10331,11 +10487,14 @@ function warnOnHookMismatchInDev(currentHookName) {
|
|
|
10331
10487
|
}
|
|
10332
10488
|
|
|
10333
10489
|
function throwInvalidHookError() {
|
|
10334
|
-
|
|
10335
|
-
|
|
10336
|
-
"
|
|
10337
|
-
|
|
10338
|
-
|
|
10490
|
+
throw new Error(
|
|
10491
|
+
"Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for" +
|
|
10492
|
+
" one of the following reasons:\n" +
|
|
10493
|
+
"1. You might have mismatching versions of React and the renderer (such as React DOM)\n" +
|
|
10494
|
+
"2. You might be breaking the Rules of Hooks\n" +
|
|
10495
|
+
"3. You might have more than one copy of React in the same app\n" +
|
|
10496
|
+
"See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem."
|
|
10497
|
+
);
|
|
10339
10498
|
}
|
|
10340
10499
|
|
|
10341
10500
|
function areHookInputsEqual(nextDeps, prevDeps) {
|
|
@@ -10443,9 +10602,10 @@ function renderWithHooks(
|
|
|
10443
10602
|
do {
|
|
10444
10603
|
didScheduleRenderPhaseUpdateDuringThisPass = false;
|
|
10445
10604
|
|
|
10446
|
-
if (
|
|
10447
|
-
throw Error(
|
|
10448
|
-
"Too many re-renders. React limits the number of renders to prevent
|
|
10605
|
+
if (numberOfReRenders >= RE_RENDER_LIMIT) {
|
|
10606
|
+
throw new Error(
|
|
10607
|
+
"Too many re-renders. React limits the number of renders to prevent " +
|
|
10608
|
+
"an infinite loop."
|
|
10449
10609
|
);
|
|
10450
10610
|
}
|
|
10451
10611
|
|
|
@@ -10511,9 +10671,10 @@ function renderWithHooks(
|
|
|
10511
10671
|
|
|
10512
10672
|
didScheduleRenderPhaseUpdate = false;
|
|
10513
10673
|
|
|
10514
|
-
if (
|
|
10515
|
-
throw Error(
|
|
10516
|
-
"Rendered fewer hooks than expected. This may be caused by an accidental
|
|
10674
|
+
if (didRenderTooFewHooks) {
|
|
10675
|
+
throw new Error(
|
|
10676
|
+
"Rendered fewer hooks than expected. This may be caused by an accidental " +
|
|
10677
|
+
"early return statement."
|
|
10517
10678
|
);
|
|
10518
10679
|
}
|
|
10519
10680
|
|
|
@@ -10635,8 +10796,8 @@ function updateWorkInProgressHook() {
|
|
|
10635
10796
|
currentHook = nextCurrentHook;
|
|
10636
10797
|
} else {
|
|
10637
10798
|
// Clone from the current hook.
|
|
10638
|
-
if (
|
|
10639
|
-
throw Error("Rendered more hooks than during the previous render.");
|
|
10799
|
+
if (nextCurrentHook === null) {
|
|
10800
|
+
throw new Error("Rendered more hooks than during the previous render.");
|
|
10640
10801
|
}
|
|
10641
10802
|
|
|
10642
10803
|
currentHook = nextCurrentHook;
|
|
@@ -10662,7 +10823,8 @@ function updateWorkInProgressHook() {
|
|
|
10662
10823
|
|
|
10663
10824
|
function createFunctionComponentUpdateQueue() {
|
|
10664
10825
|
return {
|
|
10665
|
-
lastEffect: null
|
|
10826
|
+
lastEffect: null,
|
|
10827
|
+
stores: null
|
|
10666
10828
|
};
|
|
10667
10829
|
}
|
|
10668
10830
|
|
|
@@ -10682,15 +10844,16 @@ function mountReducer(reducer, initialArg, init) {
|
|
|
10682
10844
|
}
|
|
10683
10845
|
|
|
10684
10846
|
hook.memoizedState = hook.baseState = initialState;
|
|
10685
|
-
var queue =
|
|
10847
|
+
var queue = {
|
|
10686
10848
|
pending: null,
|
|
10687
10849
|
interleaved: null,
|
|
10688
10850
|
lanes: NoLanes,
|
|
10689
10851
|
dispatch: null,
|
|
10690
10852
|
lastRenderedReducer: reducer,
|
|
10691
10853
|
lastRenderedState: initialState
|
|
10692
|
-
}
|
|
10693
|
-
|
|
10854
|
+
};
|
|
10855
|
+
hook.queue = queue;
|
|
10856
|
+
var dispatch = (queue.dispatch = dispatchReducerAction.bind(
|
|
10694
10857
|
null,
|
|
10695
10858
|
currentlyRenderingFiber$1,
|
|
10696
10859
|
queue
|
|
@@ -10702,8 +10865,8 @@ function updateReducer(reducer, initialArg, init) {
|
|
|
10702
10865
|
var hook = updateWorkInProgressHook();
|
|
10703
10866
|
var queue = hook.queue;
|
|
10704
10867
|
|
|
10705
|
-
if (
|
|
10706
|
-
throw Error(
|
|
10868
|
+
if (queue === null) {
|
|
10869
|
+
throw new Error(
|
|
10707
10870
|
"Should have a queue. This is likely a bug in React. Please file an issue."
|
|
10708
10871
|
);
|
|
10709
10872
|
}
|
|
@@ -10760,7 +10923,7 @@ function updateReducer(reducer, initialArg, init) {
|
|
|
10760
10923
|
var clone = {
|
|
10761
10924
|
lane: updateLane,
|
|
10762
10925
|
action: update.action,
|
|
10763
|
-
|
|
10926
|
+
hasEagerState: update.hasEagerState,
|
|
10764
10927
|
eagerState: update.eagerState,
|
|
10765
10928
|
next: null
|
|
10766
10929
|
};
|
|
@@ -10788,16 +10951,16 @@ function updateReducer(reducer, initialArg, init) {
|
|
|
10788
10951
|
// this will never be skipped by the check above.
|
|
10789
10952
|
lane: NoLane,
|
|
10790
10953
|
action: update.action,
|
|
10791
|
-
|
|
10954
|
+
hasEagerState: update.hasEagerState,
|
|
10792
10955
|
eagerState: update.eagerState,
|
|
10793
10956
|
next: null
|
|
10794
10957
|
};
|
|
10795
10958
|
newBaseQueueLast = newBaseQueueLast.next = _clone;
|
|
10796
10959
|
} // Process this update.
|
|
10797
10960
|
|
|
10798
|
-
if (update.
|
|
10799
|
-
// If this update
|
|
10800
|
-
//
|
|
10961
|
+
if (update.hasEagerState) {
|
|
10962
|
+
// If this update is a state update (not a reducer) and was processed eagerly,
|
|
10963
|
+
// we can use the eagerly computed state
|
|
10801
10964
|
newState = update.eagerState;
|
|
10802
10965
|
} else {
|
|
10803
10966
|
var action = update.action;
|
|
@@ -10855,8 +11018,8 @@ function rerenderReducer(reducer, initialArg, init) {
|
|
|
10855
11018
|
var hook = updateWorkInProgressHook();
|
|
10856
11019
|
var queue = hook.queue;
|
|
10857
11020
|
|
|
10858
|
-
if (
|
|
10859
|
-
throw Error(
|
|
11021
|
+
if (queue === null) {
|
|
11022
|
+
throw new Error(
|
|
10860
11023
|
"Should have a queue. This is likely a bug in React. Please file an issue."
|
|
10861
11024
|
);
|
|
10862
11025
|
}
|
|
@@ -10976,56 +11139,20 @@ function readFromUnsubscribedMutableSource(root, source, getSnapshot) {
|
|
|
10976
11139
|
// the synchronous retry, it will block interleaved mutations, so we should
|
|
10977
11140
|
// get a consistent read. Therefore, the following error should never be
|
|
10978
11141
|
// visible to the user.
|
|
10979
|
-
//
|
|
10980
|
-
// If it were to become visible to the user, it suggests one of two things:
|
|
10981
|
-
// a bug in React, or (more likely), a mutation during the render phase that
|
|
10982
|
-
// caused the second re-render attempt to be different from the first.
|
|
10983
|
-
//
|
|
10984
|
-
// We know it's the second case if the logs are currently disabled. So in
|
|
10985
|
-
// dev, we can present a more accurate error message.
|
|
10986
|
-
|
|
10987
|
-
{
|
|
10988
|
-
// eslint-disable-next-line react-internal/no-production-logging
|
|
10989
|
-
if (console.log.__reactDisabledLog) {
|
|
10990
|
-
// If the logs are disabled, this is the dev-only double render. This is
|
|
10991
|
-
// only reachable if there was a mutation during render. Show a helpful
|
|
10992
|
-
// error message.
|
|
10993
|
-
//
|
|
10994
|
-
// Something interesting to note: because we only double render in
|
|
10995
|
-
// development, this error will never happen during production. This is
|
|
10996
|
-
// actually true of all errors that occur during a double render,
|
|
10997
|
-
// because if the first render had thrown, we would have exited the
|
|
10998
|
-
// begin phase without double rendering. We should consider suppressing
|
|
10999
|
-
// any error from a double render (with a warning) to more closely match
|
|
11000
|
-
// the production behavior.
|
|
11001
|
-
var componentName = getComponentNameFromFiber(
|
|
11002
|
-
currentlyRenderingFiber$1
|
|
11003
|
-
);
|
|
11004
|
-
|
|
11005
|
-
{
|
|
11006
|
-
throw Error(
|
|
11007
|
-
"A mutable source was mutated while the " +
|
|
11008
|
-
componentName +
|
|
11009
|
-
" component was rendering. This is not supported. Move any mutations into event handlers or effects."
|
|
11010
|
-
);
|
|
11011
|
-
}
|
|
11012
|
-
}
|
|
11013
|
-
} // We expect this error not to be thrown during the synchronous retry,
|
|
11142
|
+
// We expect this error not to be thrown during the synchronous retry,
|
|
11014
11143
|
// because we blocked interleaved mutations.
|
|
11015
11144
|
|
|
11016
|
-
|
|
11017
|
-
|
|
11018
|
-
|
|
11019
|
-
);
|
|
11020
|
-
}
|
|
11145
|
+
throw new Error(
|
|
11146
|
+
"Cannot read from mutable source during the current render without tearing. This may be a bug in React. Please file an issue."
|
|
11147
|
+
);
|
|
11021
11148
|
}
|
|
11022
11149
|
}
|
|
11023
11150
|
|
|
11024
11151
|
function useMutableSource(hook, source, getSnapshot, subscribe) {
|
|
11025
11152
|
var root = getWorkInProgressRoot();
|
|
11026
11153
|
|
|
11027
|
-
if (
|
|
11028
|
-
throw Error(
|
|
11154
|
+
if (root === null) {
|
|
11155
|
+
throw new Error(
|
|
11029
11156
|
"Expected a work-in-progress root. This is a bug in React. Please file an issue."
|
|
11030
11157
|
);
|
|
11031
11158
|
}
|
|
@@ -11157,7 +11284,7 @@ function useMutableSource(hook, source, getSnapshot, subscribe) {
|
|
|
11157
11284
|
lastRenderedReducer: basicStateReducer,
|
|
11158
11285
|
lastRenderedState: snapshot
|
|
11159
11286
|
};
|
|
11160
|
-
newQueue.dispatch = setSnapshot =
|
|
11287
|
+
newQueue.dispatch = setSnapshot = dispatchSetState.bind(
|
|
11161
11288
|
null,
|
|
11162
11289
|
currentlyRenderingFiber$1,
|
|
11163
11290
|
newQueue
|
|
@@ -11189,41 +11316,243 @@ function updateMutableSource(source, getSnapshot, subscribe) {
|
|
|
11189
11316
|
return useMutableSource(hook, source, getSnapshot, subscribe);
|
|
11190
11317
|
}
|
|
11191
11318
|
|
|
11192
|
-
function
|
|
11319
|
+
function mountSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {
|
|
11320
|
+
var fiber = currentlyRenderingFiber$1;
|
|
11193
11321
|
var hook = mountWorkInProgressHook();
|
|
11322
|
+
var nextSnapshot;
|
|
11194
11323
|
|
|
11195
|
-
|
|
11196
|
-
|
|
11197
|
-
initialState = initialState();
|
|
11198
|
-
}
|
|
11324
|
+
{
|
|
11325
|
+
nextSnapshot = getSnapshot();
|
|
11199
11326
|
|
|
11200
|
-
|
|
11201
|
-
|
|
11202
|
-
|
|
11203
|
-
|
|
11204
|
-
|
|
11205
|
-
|
|
11206
|
-
lastRenderedReducer: basicStateReducer,
|
|
11207
|
-
lastRenderedState: initialState
|
|
11208
|
-
});
|
|
11209
|
-
var dispatch = (queue.dispatch = dispatchAction.bind(
|
|
11210
|
-
null,
|
|
11211
|
-
currentlyRenderingFiber$1,
|
|
11212
|
-
queue
|
|
11213
|
-
));
|
|
11214
|
-
return [hook.memoizedState, dispatch];
|
|
11215
|
-
}
|
|
11327
|
+
{
|
|
11328
|
+
if (!didWarnUncachedGetSnapshot) {
|
|
11329
|
+
if (nextSnapshot !== getSnapshot()) {
|
|
11330
|
+
error(
|
|
11331
|
+
"The result of getSnapshot should be cached to avoid an infinite loop"
|
|
11332
|
+
);
|
|
11216
11333
|
|
|
11217
|
-
|
|
11218
|
-
|
|
11219
|
-
}
|
|
11334
|
+
didWarnUncachedGetSnapshot = true;
|
|
11335
|
+
}
|
|
11336
|
+
}
|
|
11337
|
+
} // Unless we're rendering a blocking lane, schedule a consistency check.
|
|
11338
|
+
// Right before committing, we will walk the tree and check if any of the
|
|
11339
|
+
// stores were mutated.
|
|
11340
|
+
//
|
|
11341
|
+
// We won't do this if we're hydrating server-rendered content, because if
|
|
11342
|
+
// the content is stale, it's already visible anyway. Instead we'll patch
|
|
11343
|
+
// it up in a passive effect.
|
|
11220
11344
|
|
|
11221
|
-
|
|
11222
|
-
return rerenderReducer(basicStateReducer);
|
|
11223
|
-
}
|
|
11345
|
+
var root = getWorkInProgressRoot();
|
|
11224
11346
|
|
|
11225
|
-
|
|
11226
|
-
|
|
11347
|
+
if (root === null) {
|
|
11348
|
+
throw new Error(
|
|
11349
|
+
"Expected a work-in-progress root. This is a bug in React. Please file an issue."
|
|
11350
|
+
);
|
|
11351
|
+
}
|
|
11352
|
+
|
|
11353
|
+
if (!includesBlockingLane(root, renderLanes)) {
|
|
11354
|
+
pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot);
|
|
11355
|
+
}
|
|
11356
|
+
} // Read the current snapshot from the store on every render. This breaks the
|
|
11357
|
+
// normal rules of React, and only works because store updates are
|
|
11358
|
+
// always synchronous.
|
|
11359
|
+
|
|
11360
|
+
hook.memoizedState = nextSnapshot;
|
|
11361
|
+
var inst = {
|
|
11362
|
+
value: nextSnapshot,
|
|
11363
|
+
getSnapshot: getSnapshot
|
|
11364
|
+
};
|
|
11365
|
+
hook.queue = inst; // Schedule an effect to subscribe to the store.
|
|
11366
|
+
|
|
11367
|
+
mountEffect(subscribeToStore.bind(null, fiber, inst, subscribe), [subscribe]); // Schedule an effect to update the mutable instance fields. We will update
|
|
11368
|
+
// this whenever subscribe, getSnapshot, or value changes. Because there's no
|
|
11369
|
+
// clean-up function, and we track the deps correctly, we can call pushEffect
|
|
11370
|
+
// directly, without storing any additional state. For the same reason, we
|
|
11371
|
+
// don't need to set a static flag, either.
|
|
11372
|
+
// TODO: We can move this to the passive phase once we add a pre-commit
|
|
11373
|
+
// consistency check. See the next comment.
|
|
11374
|
+
|
|
11375
|
+
fiber.flags |= Passive;
|
|
11376
|
+
pushEffect(
|
|
11377
|
+
HasEffect | Passive$1,
|
|
11378
|
+
updateStoreInstance.bind(null, fiber, inst, nextSnapshot, getSnapshot),
|
|
11379
|
+
undefined,
|
|
11380
|
+
null
|
|
11381
|
+
);
|
|
11382
|
+
return nextSnapshot;
|
|
11383
|
+
}
|
|
11384
|
+
|
|
11385
|
+
function updateSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {
|
|
11386
|
+
var fiber = currentlyRenderingFiber$1;
|
|
11387
|
+
var hook = updateWorkInProgressHook(); // Read the current snapshot from the store on every render. This breaks the
|
|
11388
|
+
// normal rules of React, and only works because store updates are
|
|
11389
|
+
// always synchronous.
|
|
11390
|
+
|
|
11391
|
+
var nextSnapshot = getSnapshot();
|
|
11392
|
+
|
|
11393
|
+
{
|
|
11394
|
+
if (!didWarnUncachedGetSnapshot) {
|
|
11395
|
+
if (nextSnapshot !== getSnapshot()) {
|
|
11396
|
+
error(
|
|
11397
|
+
"The result of getSnapshot should be cached to avoid an infinite loop"
|
|
11398
|
+
);
|
|
11399
|
+
|
|
11400
|
+
didWarnUncachedGetSnapshot = true;
|
|
11401
|
+
}
|
|
11402
|
+
}
|
|
11403
|
+
}
|
|
11404
|
+
|
|
11405
|
+
var prevSnapshot = hook.memoizedState;
|
|
11406
|
+
var snapshotChanged = !objectIs(prevSnapshot, nextSnapshot);
|
|
11407
|
+
|
|
11408
|
+
if (snapshotChanged) {
|
|
11409
|
+
hook.memoizedState = nextSnapshot;
|
|
11410
|
+
markWorkInProgressReceivedUpdate();
|
|
11411
|
+
}
|
|
11412
|
+
|
|
11413
|
+
var inst = hook.queue;
|
|
11414
|
+
updateEffect(subscribeToStore.bind(null, fiber, inst, subscribe), [
|
|
11415
|
+
subscribe
|
|
11416
|
+
]); // Whenever getSnapshot or subscribe changes, we need to check in the
|
|
11417
|
+
// commit phase if there was an interleaved mutation. In concurrent mode
|
|
11418
|
+
// this can happen all the time, but even in synchronous mode, an earlier
|
|
11419
|
+
// effect may have mutated the store.
|
|
11420
|
+
|
|
11421
|
+
if (
|
|
11422
|
+
inst.getSnapshot !== getSnapshot ||
|
|
11423
|
+
snapshotChanged || // Check if the susbcribe function changed. We can save some memory by
|
|
11424
|
+
// checking whether we scheduled a subscription effect above.
|
|
11425
|
+
(workInProgressHook !== null &&
|
|
11426
|
+
workInProgressHook.memoizedState.tag & HasEffect)
|
|
11427
|
+
) {
|
|
11428
|
+
fiber.flags |= Passive;
|
|
11429
|
+
pushEffect(
|
|
11430
|
+
HasEffect | Passive$1,
|
|
11431
|
+
updateStoreInstance.bind(null, fiber, inst, nextSnapshot, getSnapshot),
|
|
11432
|
+
undefined,
|
|
11433
|
+
null
|
|
11434
|
+
); // Unless we're rendering a blocking lane, schedule a consistency check.
|
|
11435
|
+
// Right before committing, we will walk the tree and check if any of the
|
|
11436
|
+
// stores were mutated.
|
|
11437
|
+
|
|
11438
|
+
var root = getWorkInProgressRoot();
|
|
11439
|
+
|
|
11440
|
+
if (root === null) {
|
|
11441
|
+
throw new Error(
|
|
11442
|
+
"Expected a work-in-progress root. This is a bug in React. Please file an issue."
|
|
11443
|
+
);
|
|
11444
|
+
}
|
|
11445
|
+
|
|
11446
|
+
if (!includesBlockingLane(root, renderLanes)) {
|
|
11447
|
+
pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot);
|
|
11448
|
+
}
|
|
11449
|
+
}
|
|
11450
|
+
|
|
11451
|
+
return nextSnapshot;
|
|
11452
|
+
}
|
|
11453
|
+
|
|
11454
|
+
function pushStoreConsistencyCheck(fiber, getSnapshot, renderedSnapshot) {
|
|
11455
|
+
fiber.flags |= StoreConsistency;
|
|
11456
|
+
var check = {
|
|
11457
|
+
getSnapshot: getSnapshot,
|
|
11458
|
+
value: renderedSnapshot
|
|
11459
|
+
};
|
|
11460
|
+
var componentUpdateQueue = currentlyRenderingFiber$1.updateQueue;
|
|
11461
|
+
|
|
11462
|
+
if (componentUpdateQueue === null) {
|
|
11463
|
+
componentUpdateQueue = createFunctionComponentUpdateQueue();
|
|
11464
|
+
currentlyRenderingFiber$1.updateQueue = componentUpdateQueue;
|
|
11465
|
+
componentUpdateQueue.stores = [check];
|
|
11466
|
+
} else {
|
|
11467
|
+
var stores = componentUpdateQueue.stores;
|
|
11468
|
+
|
|
11469
|
+
if (stores === null) {
|
|
11470
|
+
componentUpdateQueue.stores = [check];
|
|
11471
|
+
} else {
|
|
11472
|
+
stores.push(check);
|
|
11473
|
+
}
|
|
11474
|
+
}
|
|
11475
|
+
}
|
|
11476
|
+
|
|
11477
|
+
function updateStoreInstance(fiber, inst, nextSnapshot, getSnapshot) {
|
|
11478
|
+
// These are updated in the passive phase
|
|
11479
|
+
inst.value = nextSnapshot;
|
|
11480
|
+
inst.getSnapshot = getSnapshot; // Something may have been mutated in between render and commit. This could
|
|
11481
|
+
// have been in an event that fired before the passive effects, or it could
|
|
11482
|
+
// have been in a layout effect. In that case, we would have used the old
|
|
11483
|
+
// snapsho and getSnapshot values to bail out. We need to check one more time.
|
|
11484
|
+
|
|
11485
|
+
if (checkIfSnapshotChanged(inst)) {
|
|
11486
|
+
// Force a re-render.
|
|
11487
|
+
forceStoreRerender(fiber);
|
|
11488
|
+
}
|
|
11489
|
+
}
|
|
11490
|
+
|
|
11491
|
+
function subscribeToStore(fiber, inst, subscribe) {
|
|
11492
|
+
var handleStoreChange = function() {
|
|
11493
|
+
// The store changed. Check if the snapshot changed since the last time we
|
|
11494
|
+
// read from the store.
|
|
11495
|
+
if (checkIfSnapshotChanged(inst)) {
|
|
11496
|
+
// Force a re-render.
|
|
11497
|
+
forceStoreRerender(fiber);
|
|
11498
|
+
}
|
|
11499
|
+
}; // Subscribe to the store and return a clean-up function.
|
|
11500
|
+
|
|
11501
|
+
return subscribe(handleStoreChange);
|
|
11502
|
+
}
|
|
11503
|
+
|
|
11504
|
+
function checkIfSnapshotChanged(inst) {
|
|
11505
|
+
var latestGetSnapshot = inst.getSnapshot;
|
|
11506
|
+
var prevValue = inst.value;
|
|
11507
|
+
|
|
11508
|
+
try {
|
|
11509
|
+
var nextValue = latestGetSnapshot();
|
|
11510
|
+
return !objectIs(prevValue, nextValue);
|
|
11511
|
+
} catch (error) {
|
|
11512
|
+
return true;
|
|
11513
|
+
}
|
|
11514
|
+
}
|
|
11515
|
+
|
|
11516
|
+
function forceStoreRerender(fiber) {
|
|
11517
|
+
scheduleUpdateOnFiber(fiber, SyncLane, NoTimestamp);
|
|
11518
|
+
}
|
|
11519
|
+
|
|
11520
|
+
function mountState(initialState) {
|
|
11521
|
+
var hook = mountWorkInProgressHook();
|
|
11522
|
+
|
|
11523
|
+
if (typeof initialState === "function") {
|
|
11524
|
+
// $FlowFixMe: Flow doesn't like mixed types
|
|
11525
|
+
initialState = initialState();
|
|
11526
|
+
}
|
|
11527
|
+
|
|
11528
|
+
hook.memoizedState = hook.baseState = initialState;
|
|
11529
|
+
var queue = {
|
|
11530
|
+
pending: null,
|
|
11531
|
+
interleaved: null,
|
|
11532
|
+
lanes: NoLanes,
|
|
11533
|
+
dispatch: null,
|
|
11534
|
+
lastRenderedReducer: basicStateReducer,
|
|
11535
|
+
lastRenderedState: initialState
|
|
11536
|
+
};
|
|
11537
|
+
hook.queue = queue;
|
|
11538
|
+
var dispatch = (queue.dispatch = dispatchSetState.bind(
|
|
11539
|
+
null,
|
|
11540
|
+
currentlyRenderingFiber$1,
|
|
11541
|
+
queue
|
|
11542
|
+
));
|
|
11543
|
+
return [hook.memoizedState, dispatch];
|
|
11544
|
+
}
|
|
11545
|
+
|
|
11546
|
+
function updateState(initialState) {
|
|
11547
|
+
return updateReducer(basicStateReducer);
|
|
11548
|
+
}
|
|
11549
|
+
|
|
11550
|
+
function rerenderState(initialState) {
|
|
11551
|
+
return rerenderReducer(basicStateReducer);
|
|
11552
|
+
}
|
|
11553
|
+
|
|
11554
|
+
function pushEffect(tag, create, destroy, deps) {
|
|
11555
|
+
var effect = {
|
|
11227
11556
|
tag: tag,
|
|
11228
11557
|
create: create,
|
|
11229
11558
|
destroy: destroy,
|
|
@@ -11341,6 +11670,14 @@ function updateEffect(create, deps) {
|
|
|
11341
11670
|
return updateEffectImpl(Passive, Passive$1, create, deps);
|
|
11342
11671
|
}
|
|
11343
11672
|
|
|
11673
|
+
function mountInsertionEffect(create, deps) {
|
|
11674
|
+
return mountEffectImpl(Update, Insertion, create, deps);
|
|
11675
|
+
}
|
|
11676
|
+
|
|
11677
|
+
function updateInsertionEffect(create, deps) {
|
|
11678
|
+
return updateEffectImpl(Update, Insertion, create, deps);
|
|
11679
|
+
}
|
|
11680
|
+
|
|
11344
11681
|
function mountLayoutEffect(create, deps) {
|
|
11345
11682
|
var fiberFlags = Update;
|
|
11346
11683
|
|
|
@@ -11576,6 +11913,26 @@ function startTransition(setPending, callback) {
|
|
|
11576
11913
|
} finally {
|
|
11577
11914
|
setCurrentUpdatePriority(previousPriority);
|
|
11578
11915
|
ReactCurrentBatchConfig$1.transition = prevTransition;
|
|
11916
|
+
|
|
11917
|
+
{
|
|
11918
|
+
if (
|
|
11919
|
+
prevTransition !== 1 &&
|
|
11920
|
+
warnOnSubscriptionInsideStartTransition &&
|
|
11921
|
+
ReactCurrentBatchConfig$1._updatedFibers
|
|
11922
|
+
) {
|
|
11923
|
+
var updatedFibersCount = ReactCurrentBatchConfig$1._updatedFibers.size;
|
|
11924
|
+
|
|
11925
|
+
if (updatedFibersCount > 10) {
|
|
11926
|
+
warn(
|
|
11927
|
+
"Detected a large number of updates inside startTransition. " +
|
|
11928
|
+
"If this is due to a subscription please re-write it to use React provided hooks. " +
|
|
11929
|
+
"Otherwise concurrent mode guarantees are off the table."
|
|
11930
|
+
);
|
|
11931
|
+
}
|
|
11932
|
+
|
|
11933
|
+
ReactCurrentBatchConfig$1._updatedFibers.clear();
|
|
11934
|
+
}
|
|
11935
|
+
}
|
|
11579
11936
|
}
|
|
11580
11937
|
}
|
|
11581
11938
|
|
|
@@ -11656,7 +12013,7 @@ function rerenderOpaqueIdentifier() {
|
|
|
11656
12013
|
return id;
|
|
11657
12014
|
}
|
|
11658
12015
|
|
|
11659
|
-
function
|
|
12016
|
+
function dispatchReducerAction(fiber, queue, action) {
|
|
11660
12017
|
{
|
|
11661
12018
|
if (typeof arguments[3] === "function") {
|
|
11662
12019
|
error(
|
|
@@ -11667,65 +12024,61 @@ function dispatchAction(fiber, queue, action) {
|
|
|
11667
12024
|
}
|
|
11668
12025
|
}
|
|
11669
12026
|
|
|
11670
|
-
var eventTime = requestEventTime();
|
|
11671
12027
|
var lane = requestUpdateLane(fiber);
|
|
11672
12028
|
var update = {
|
|
11673
12029
|
lane: lane,
|
|
11674
12030
|
action: action,
|
|
11675
|
-
|
|
12031
|
+
hasEagerState: false,
|
|
11676
12032
|
eagerState: null,
|
|
11677
12033
|
next: null
|
|
11678
12034
|
};
|
|
11679
|
-
var alternate = fiber.alternate;
|
|
11680
12035
|
|
|
11681
|
-
if (
|
|
11682
|
-
|
|
11683
|
-
(alternate !== null && alternate === currentlyRenderingFiber$1)
|
|
11684
|
-
) {
|
|
11685
|
-
// This is a render phase update. Stash it in a lazily-created map of
|
|
11686
|
-
// queue -> linked list of updates. After this render pass, we'll restart
|
|
11687
|
-
// and apply the stashed updates on top of the work-in-progress hook.
|
|
11688
|
-
didScheduleRenderPhaseUpdateDuringThisPass = didScheduleRenderPhaseUpdate = true;
|
|
11689
|
-
var pending = queue.pending;
|
|
11690
|
-
|
|
11691
|
-
if (pending === null) {
|
|
11692
|
-
// This is the first update. Create a circular list.
|
|
11693
|
-
update.next = update;
|
|
11694
|
-
} else {
|
|
11695
|
-
update.next = pending.next;
|
|
11696
|
-
pending.next = update;
|
|
11697
|
-
}
|
|
11698
|
-
|
|
11699
|
-
queue.pending = update;
|
|
12036
|
+
if (isRenderPhaseUpdate(fiber)) {
|
|
12037
|
+
enqueueRenderPhaseUpdate(queue, update);
|
|
11700
12038
|
} else {
|
|
11701
|
-
|
|
11702
|
-
var interleaved = queue.interleaved;
|
|
11703
|
-
|
|
11704
|
-
if (interleaved === null) {
|
|
11705
|
-
// This is the first update. Create a circular list.
|
|
11706
|
-
update.next = update; // At the end of the current render, this queue's interleaved updates will
|
|
11707
|
-
// be transferred to the pending queue.
|
|
12039
|
+
enqueueUpdate$1(fiber, queue, update);
|
|
11708
12040
|
|
|
11709
|
-
|
|
11710
|
-
|
|
11711
|
-
|
|
11712
|
-
|
|
12041
|
+
{
|
|
12042
|
+
// $FlowExpectedError - jest isn't a global, and isn't recognized outside of tests
|
|
12043
|
+
if ("undefined" !== typeof jest) {
|
|
12044
|
+
warnIfNotCurrentlyActingUpdatesInDev(fiber);
|
|
11713
12045
|
}
|
|
12046
|
+
}
|
|
11714
12047
|
|
|
11715
|
-
|
|
11716
|
-
|
|
11717
|
-
var _pending = queue.pending;
|
|
12048
|
+
var eventTime = requestEventTime();
|
|
12049
|
+
var root = scheduleUpdateOnFiber(fiber, lane, eventTime);
|
|
11718
12050
|
|
|
11719
|
-
|
|
11720
|
-
|
|
11721
|
-
|
|
11722
|
-
|
|
11723
|
-
|
|
11724
|
-
_pending.next = update;
|
|
11725
|
-
}
|
|
12051
|
+
if (root !== null) {
|
|
12052
|
+
entangleTransitionUpdate(root, queue, lane);
|
|
12053
|
+
}
|
|
12054
|
+
}
|
|
12055
|
+
}
|
|
11726
12056
|
|
|
11727
|
-
|
|
12057
|
+
function dispatchSetState(fiber, queue, action) {
|
|
12058
|
+
{
|
|
12059
|
+
if (typeof arguments[3] === "function") {
|
|
12060
|
+
error(
|
|
12061
|
+
"State updates from the useState() and useReducer() Hooks don't support the " +
|
|
12062
|
+
"second callback argument. To execute a side effect after " +
|
|
12063
|
+
"rendering, declare it in the component body with useEffect()."
|
|
12064
|
+
);
|
|
11728
12065
|
}
|
|
12066
|
+
}
|
|
12067
|
+
|
|
12068
|
+
var lane = requestUpdateLane(fiber);
|
|
12069
|
+
var update = {
|
|
12070
|
+
lane: lane,
|
|
12071
|
+
action: action,
|
|
12072
|
+
hasEagerState: false,
|
|
12073
|
+
eagerState: null,
|
|
12074
|
+
next: null
|
|
12075
|
+
};
|
|
12076
|
+
|
|
12077
|
+
if (isRenderPhaseUpdate(fiber)) {
|
|
12078
|
+
enqueueRenderPhaseUpdate(queue, update);
|
|
12079
|
+
} else {
|
|
12080
|
+
enqueueUpdate$1(fiber, queue, update);
|
|
12081
|
+
var alternate = fiber.alternate;
|
|
11729
12082
|
|
|
11730
12083
|
if (
|
|
11731
12084
|
fiber.lanes === NoLanes &&
|
|
@@ -11751,7 +12104,7 @@ function dispatchAction(fiber, queue, action) {
|
|
|
11751
12104
|
// time we enter the render phase, then the eager state can be used
|
|
11752
12105
|
// without calling the reducer again.
|
|
11753
12106
|
|
|
11754
|
-
update.
|
|
12107
|
+
update.hasEagerState = true;
|
|
11755
12108
|
update.eagerState = eagerState;
|
|
11756
12109
|
|
|
11757
12110
|
if (objectIs(eagerState, currentState)) {
|
|
@@ -11778,24 +12131,88 @@ function dispatchAction(fiber, queue, action) {
|
|
|
11778
12131
|
}
|
|
11779
12132
|
}
|
|
11780
12133
|
|
|
12134
|
+
var eventTime = requestEventTime();
|
|
11781
12135
|
var root = scheduleUpdateOnFiber(fiber, lane, eventTime);
|
|
11782
12136
|
|
|
11783
|
-
if (
|
|
11784
|
-
|
|
11785
|
-
|
|
11786
|
-
|
|
11787
|
-
|
|
11788
|
-
// we *don't* entangle when we should.
|
|
12137
|
+
if (root !== null) {
|
|
12138
|
+
entangleTransitionUpdate(root, queue, lane);
|
|
12139
|
+
}
|
|
12140
|
+
}
|
|
12141
|
+
}
|
|
11789
12142
|
|
|
11790
|
-
|
|
12143
|
+
function isRenderPhaseUpdate(fiber) {
|
|
12144
|
+
var alternate = fiber.alternate;
|
|
12145
|
+
return (
|
|
12146
|
+
fiber === currentlyRenderingFiber$1 ||
|
|
12147
|
+
(alternate !== null && alternate === currentlyRenderingFiber$1)
|
|
12148
|
+
);
|
|
12149
|
+
}
|
|
11791
12150
|
|
|
11792
|
-
|
|
11793
|
-
|
|
11794
|
-
|
|
11795
|
-
|
|
12151
|
+
function enqueueRenderPhaseUpdate(queue, update) {
|
|
12152
|
+
// This is a render phase update. Stash it in a lazily-created map of
|
|
12153
|
+
// queue -> linked list of updates. After this render pass, we'll restart
|
|
12154
|
+
// and apply the stashed updates on top of the work-in-progress hook.
|
|
12155
|
+
didScheduleRenderPhaseUpdateDuringThisPass = didScheduleRenderPhaseUpdate = true;
|
|
12156
|
+
var pending = queue.pending;
|
|
11796
12157
|
|
|
11797
|
-
|
|
12158
|
+
if (pending === null) {
|
|
12159
|
+
// This is the first update. Create a circular list.
|
|
12160
|
+
update.next = update;
|
|
12161
|
+
} else {
|
|
12162
|
+
update.next = pending.next;
|
|
12163
|
+
pending.next = update;
|
|
12164
|
+
}
|
|
12165
|
+
|
|
12166
|
+
queue.pending = update;
|
|
12167
|
+
}
|
|
12168
|
+
|
|
12169
|
+
function enqueueUpdate$1(fiber, queue, update, lane) {
|
|
12170
|
+
if (isInterleavedUpdate(fiber)) {
|
|
12171
|
+
var interleaved = queue.interleaved;
|
|
12172
|
+
|
|
12173
|
+
if (interleaved === null) {
|
|
12174
|
+
// This is the first update. Create a circular list.
|
|
12175
|
+
update.next = update; // At the end of the current render, this queue's interleaved updates will
|
|
12176
|
+
// be transferred to the pending queue.
|
|
12177
|
+
|
|
12178
|
+
pushInterleavedQueue(queue);
|
|
12179
|
+
} else {
|
|
12180
|
+
update.next = interleaved.next;
|
|
12181
|
+
interleaved.next = update;
|
|
11798
12182
|
}
|
|
12183
|
+
|
|
12184
|
+
queue.interleaved = update;
|
|
12185
|
+
} else {
|
|
12186
|
+
var pending = queue.pending;
|
|
12187
|
+
|
|
12188
|
+
if (pending === null) {
|
|
12189
|
+
// This is the first update. Create a circular list.
|
|
12190
|
+
update.next = update;
|
|
12191
|
+
} else {
|
|
12192
|
+
update.next = pending.next;
|
|
12193
|
+
pending.next = update;
|
|
12194
|
+
}
|
|
12195
|
+
|
|
12196
|
+
queue.pending = update;
|
|
12197
|
+
}
|
|
12198
|
+
}
|
|
12199
|
+
|
|
12200
|
+
function entangleTransitionUpdate(root, queue, lane) {
|
|
12201
|
+
if (isTransitionLane(lane)) {
|
|
12202
|
+
var queueLanes = queue.lanes; // If any entangled lanes are no longer pending on the root, then they
|
|
12203
|
+
// must have finished. We can remove them from the shared queue, which
|
|
12204
|
+
// represents a superset of the actually pending lanes. In some cases we
|
|
12205
|
+
// may entangle more than we need to, but that's OK. In fact it's worse if
|
|
12206
|
+
// we *don't* entangle when we should.
|
|
12207
|
+
|
|
12208
|
+
queueLanes = intersectLanes(queueLanes, root.pendingLanes); // Entangle the new transition lane with the other transition lanes.
|
|
12209
|
+
|
|
12210
|
+
var newQueueLanes = mergeLanes(queueLanes, lane);
|
|
12211
|
+
queue.lanes = newQueueLanes; // Even if queue.lanes already include lane, we don't know for certain if
|
|
12212
|
+
// the lane finished since the last time we entangled it. So we need to
|
|
12213
|
+
// entangle it again, just to be sure.
|
|
12214
|
+
|
|
12215
|
+
markRootEntangled(root, newQueueLanes);
|
|
11799
12216
|
}
|
|
11800
12217
|
}
|
|
11801
12218
|
|
|
@@ -11805,6 +12222,7 @@ var ContextOnlyDispatcher = {
|
|
|
11805
12222
|
useContext: throwInvalidHookError,
|
|
11806
12223
|
useEffect: throwInvalidHookError,
|
|
11807
12224
|
useImperativeHandle: throwInvalidHookError,
|
|
12225
|
+
useInsertionEffect: throwInvalidHookError,
|
|
11808
12226
|
useLayoutEffect: throwInvalidHookError,
|
|
11809
12227
|
useMemo: throwInvalidHookError,
|
|
11810
12228
|
useReducer: throwInvalidHookError,
|
|
@@ -11814,6 +12232,7 @@ var ContextOnlyDispatcher = {
|
|
|
11814
12232
|
useDeferredValue: throwInvalidHookError,
|
|
11815
12233
|
useTransition: throwInvalidHookError,
|
|
11816
12234
|
useMutableSource: throwInvalidHookError,
|
|
12235
|
+
useSyncExternalStore: throwInvalidHookError,
|
|
11817
12236
|
useOpaqueIdentifier: throwInvalidHookError,
|
|
11818
12237
|
unstable_isNewReconciler: enableNewReconciler
|
|
11819
12238
|
};
|
|
@@ -11872,6 +12291,12 @@ var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
|
|
|
11872
12291
|
checkDepsAreArrayDev(deps);
|
|
11873
12292
|
return mountImperativeHandle(ref, create, deps);
|
|
11874
12293
|
},
|
|
12294
|
+
useInsertionEffect: function(create, deps) {
|
|
12295
|
+
currentHookNameInDev = "useInsertionEffect";
|
|
12296
|
+
mountHookTypesDev();
|
|
12297
|
+
checkDepsAreArrayDev(deps);
|
|
12298
|
+
return mountInsertionEffect(create, deps);
|
|
12299
|
+
},
|
|
11875
12300
|
useLayoutEffect: function(create, deps) {
|
|
11876
12301
|
currentHookNameInDev = "useLayoutEffect";
|
|
11877
12302
|
mountHookTypesDev();
|
|
@@ -11940,6 +12365,11 @@ var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
|
|
|
11940
12365
|
mountHookTypesDev();
|
|
11941
12366
|
return mountMutableSource(source, getSnapshot, subscribe);
|
|
11942
12367
|
},
|
|
12368
|
+
useSyncExternalStore: function(subscribe, getSnapshot, getServerSnapshot) {
|
|
12369
|
+
currentHookNameInDev = "useSyncExternalStore";
|
|
12370
|
+
mountHookTypesDev();
|
|
12371
|
+
return mountSyncExternalStore(subscribe, getSnapshot);
|
|
12372
|
+
},
|
|
11943
12373
|
useOpaqueIdentifier: function() {
|
|
11944
12374
|
currentHookNameInDev = "useOpaqueIdentifier";
|
|
11945
12375
|
mountHookTypesDev();
|
|
@@ -11972,6 +12402,11 @@ var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
|
|
|
11972
12402
|
updateHookTypesDev();
|
|
11973
12403
|
return mountImperativeHandle(ref, create, deps);
|
|
11974
12404
|
},
|
|
12405
|
+
useInsertionEffect: function(create, deps) {
|
|
12406
|
+
currentHookNameInDev = "useInsertionEffect";
|
|
12407
|
+
updateHookTypesDev();
|
|
12408
|
+
return mountInsertionEffect(create, deps);
|
|
12409
|
+
},
|
|
11975
12410
|
useLayoutEffect: function(create, deps) {
|
|
11976
12411
|
currentHookNameInDev = "useLayoutEffect";
|
|
11977
12412
|
updateHookTypesDev();
|
|
@@ -12038,6 +12473,11 @@ var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
|
|
|
12038
12473
|
updateHookTypesDev();
|
|
12039
12474
|
return mountMutableSource(source, getSnapshot, subscribe);
|
|
12040
12475
|
},
|
|
12476
|
+
useSyncExternalStore: function(subscribe, getSnapshot, getServerSnapshot) {
|
|
12477
|
+
currentHookNameInDev = "useSyncExternalStore";
|
|
12478
|
+
updateHookTypesDev();
|
|
12479
|
+
return mountSyncExternalStore(subscribe, getSnapshot);
|
|
12480
|
+
},
|
|
12041
12481
|
useOpaqueIdentifier: function() {
|
|
12042
12482
|
currentHookNameInDev = "useOpaqueIdentifier";
|
|
12043
12483
|
updateHookTypesDev();
|
|
@@ -12070,6 +12510,11 @@ var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
|
|
|
12070
12510
|
updateHookTypesDev();
|
|
12071
12511
|
return updateImperativeHandle(ref, create, deps);
|
|
12072
12512
|
},
|
|
12513
|
+
useInsertionEffect: function(create, deps) {
|
|
12514
|
+
currentHookNameInDev = "useInsertionEffect";
|
|
12515
|
+
updateHookTypesDev();
|
|
12516
|
+
return updateInsertionEffect(create, deps);
|
|
12517
|
+
},
|
|
12073
12518
|
useLayoutEffect: function(create, deps) {
|
|
12074
12519
|
currentHookNameInDev = "useLayoutEffect";
|
|
12075
12520
|
updateHookTypesDev();
|
|
@@ -12136,6 +12581,11 @@ var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
|
|
|
12136
12581
|
updateHookTypesDev();
|
|
12137
12582
|
return updateMutableSource(source, getSnapshot, subscribe);
|
|
12138
12583
|
},
|
|
12584
|
+
useSyncExternalStore: function(subscribe, getSnapshot, getServerSnapshot) {
|
|
12585
|
+
currentHookNameInDev = "useSyncExternalStore";
|
|
12586
|
+
updateHookTypesDev();
|
|
12587
|
+
return updateSyncExternalStore(subscribe, getSnapshot);
|
|
12588
|
+
},
|
|
12139
12589
|
useOpaqueIdentifier: function() {
|
|
12140
12590
|
currentHookNameInDev = "useOpaqueIdentifier";
|
|
12141
12591
|
updateHookTypesDev();
|
|
@@ -12168,6 +12618,11 @@ var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
|
|
|
12168
12618
|
updateHookTypesDev();
|
|
12169
12619
|
return updateImperativeHandle(ref, create, deps);
|
|
12170
12620
|
},
|
|
12621
|
+
useInsertionEffect: function(create, deps) {
|
|
12622
|
+
currentHookNameInDev = "useInsertionEffect";
|
|
12623
|
+
updateHookTypesDev();
|
|
12624
|
+
return updateInsertionEffect(create, deps);
|
|
12625
|
+
},
|
|
12171
12626
|
useLayoutEffect: function(create, deps) {
|
|
12172
12627
|
currentHookNameInDev = "useLayoutEffect";
|
|
12173
12628
|
updateHookTypesDev();
|
|
@@ -12234,6 +12689,11 @@ var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
|
|
|
12234
12689
|
updateHookTypesDev();
|
|
12235
12690
|
return updateMutableSource(source, getSnapshot, subscribe);
|
|
12236
12691
|
},
|
|
12692
|
+
useSyncExternalStore: function(subscribe, getSnapshot, getServerSnapshot) {
|
|
12693
|
+
currentHookNameInDev = "useSyncExternalStore";
|
|
12694
|
+
updateHookTypesDev();
|
|
12695
|
+
return updateSyncExternalStore(subscribe, getSnapshot);
|
|
12696
|
+
},
|
|
12237
12697
|
useOpaqueIdentifier: function() {
|
|
12238
12698
|
currentHookNameInDev = "useOpaqueIdentifier";
|
|
12239
12699
|
updateHookTypesDev();
|
|
@@ -12271,6 +12731,12 @@ var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
|
|
|
12271
12731
|
mountHookTypesDev();
|
|
12272
12732
|
return mountImperativeHandle(ref, create, deps);
|
|
12273
12733
|
},
|
|
12734
|
+
useInsertionEffect: function(create, deps) {
|
|
12735
|
+
currentHookNameInDev = "useInsertionEffect";
|
|
12736
|
+
warnInvalidHookAccess();
|
|
12737
|
+
mountHookTypesDev();
|
|
12738
|
+
return mountInsertionEffect(create, deps);
|
|
12739
|
+
},
|
|
12274
12740
|
useLayoutEffect: function(create, deps) {
|
|
12275
12741
|
currentHookNameInDev = "useLayoutEffect";
|
|
12276
12742
|
warnInvalidHookAccess();
|
|
@@ -12346,6 +12812,12 @@ var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
|
|
|
12346
12812
|
mountHookTypesDev();
|
|
12347
12813
|
return mountMutableSource(source, getSnapshot, subscribe);
|
|
12348
12814
|
},
|
|
12815
|
+
useSyncExternalStore: function(subscribe, getSnapshot, getServerSnapshot) {
|
|
12816
|
+
currentHookNameInDev = "useSyncExternalStore";
|
|
12817
|
+
warnInvalidHookAccess();
|
|
12818
|
+
mountHookTypesDev();
|
|
12819
|
+
return mountSyncExternalStore(subscribe, getSnapshot);
|
|
12820
|
+
},
|
|
12349
12821
|
useOpaqueIdentifier: function() {
|
|
12350
12822
|
currentHookNameInDev = "useOpaqueIdentifier";
|
|
12351
12823
|
warnInvalidHookAccess();
|
|
@@ -12384,6 +12856,12 @@ var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
|
|
|
12384
12856
|
updateHookTypesDev();
|
|
12385
12857
|
return updateImperativeHandle(ref, create, deps);
|
|
12386
12858
|
},
|
|
12859
|
+
useInsertionEffect: function(create, deps) {
|
|
12860
|
+
currentHookNameInDev = "useInsertionEffect";
|
|
12861
|
+
warnInvalidHookAccess();
|
|
12862
|
+
updateHookTypesDev();
|
|
12863
|
+
return updateInsertionEffect(create, deps);
|
|
12864
|
+
},
|
|
12387
12865
|
useLayoutEffect: function(create, deps) {
|
|
12388
12866
|
currentHookNameInDev = "useLayoutEffect";
|
|
12389
12867
|
warnInvalidHookAccess();
|
|
@@ -12459,6 +12937,12 @@ var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
|
|
|
12459
12937
|
updateHookTypesDev();
|
|
12460
12938
|
return updateMutableSource(source, getSnapshot, subscribe);
|
|
12461
12939
|
},
|
|
12940
|
+
useSyncExternalStore: function(subscribe, getSnapshot, getServerSnapshot) {
|
|
12941
|
+
currentHookNameInDev = "useSyncExternalStore";
|
|
12942
|
+
warnInvalidHookAccess();
|
|
12943
|
+
updateHookTypesDev();
|
|
12944
|
+
return updateSyncExternalStore(subscribe, getSnapshot);
|
|
12945
|
+
},
|
|
12462
12946
|
useOpaqueIdentifier: function() {
|
|
12463
12947
|
currentHookNameInDev = "useOpaqueIdentifier";
|
|
12464
12948
|
warnInvalidHookAccess();
|
|
@@ -12497,6 +12981,12 @@ var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
|
|
|
12497
12981
|
updateHookTypesDev();
|
|
12498
12982
|
return updateImperativeHandle(ref, create, deps);
|
|
12499
12983
|
},
|
|
12984
|
+
useInsertionEffect: function(create, deps) {
|
|
12985
|
+
currentHookNameInDev = "useInsertionEffect";
|
|
12986
|
+
warnInvalidHookAccess();
|
|
12987
|
+
updateHookTypesDev();
|
|
12988
|
+
return updateInsertionEffect(create, deps);
|
|
12989
|
+
},
|
|
12500
12990
|
useLayoutEffect: function(create, deps) {
|
|
12501
12991
|
currentHookNameInDev = "useLayoutEffect";
|
|
12502
12992
|
warnInvalidHookAccess();
|
|
@@ -12572,6 +13062,12 @@ var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
|
|
|
12572
13062
|
updateHookTypesDev();
|
|
12573
13063
|
return updateMutableSource(source, getSnapshot, subscribe);
|
|
12574
13064
|
},
|
|
13065
|
+
useSyncExternalStore: function(subscribe, getSnapshot, getServerSnapshot) {
|
|
13066
|
+
currentHookNameInDev = "useSyncExternalStore";
|
|
13067
|
+
warnInvalidHookAccess();
|
|
13068
|
+
updateHookTypesDev();
|
|
13069
|
+
return updateSyncExternalStore(subscribe, getSnapshot);
|
|
13070
|
+
},
|
|
12575
13071
|
useOpaqueIdentifier: function() {
|
|
12576
13072
|
currentHookNameInDev = "useOpaqueIdentifier";
|
|
12577
13073
|
warnInvalidHookAccess();
|
|
@@ -12758,12 +13254,10 @@ function createCapturedValue(value, source) {
|
|
|
12758
13254
|
}
|
|
12759
13255
|
|
|
12760
13256
|
if (
|
|
12761
|
-
|
|
12762
|
-
|
|
12763
|
-
"function"
|
|
12764
|
-
)
|
|
13257
|
+
typeof ReactNativePrivateInterface.ReactFiberErrorDialog.showErrorDialog !==
|
|
13258
|
+
"function"
|
|
12765
13259
|
) {
|
|
12766
|
-
throw Error(
|
|
13260
|
+
throw new Error(
|
|
12767
13261
|
"Expected ReactFiberErrorDialog.showErrorDialog to be a function."
|
|
12768
13262
|
);
|
|
12769
13263
|
}
|
|
@@ -12949,129 +13443,144 @@ function createClassErrorUpdate(fiber, errorInfo, lane) {
|
|
|
12949
13443
|
return update;
|
|
12950
13444
|
}
|
|
12951
13445
|
|
|
12952
|
-
function
|
|
12953
|
-
// Attach a
|
|
12954
|
-
//
|
|
12955
|
-
//
|
|
12956
|
-
|
|
12957
|
-
|
|
12958
|
-
|
|
12959
|
-
|
|
12960
|
-
|
|
12961
|
-
|
|
12962
|
-
|
|
12963
|
-
|
|
12964
|
-
|
|
12965
|
-
|
|
12966
|
-
|
|
13446
|
+
function attachWakeableListeners(suspenseBoundary, root, wakeable, lanes) {
|
|
13447
|
+
// Attach a ping listener
|
|
13448
|
+
//
|
|
13449
|
+
// The data might resolve before we have a chance to commit the fallback. Or,
|
|
13450
|
+
// in the case of a refresh, we'll never commit a fallback. So we need to
|
|
13451
|
+
// attach a listener now. When it resolves ("pings"), we can decide whether to
|
|
13452
|
+
// try rendering the tree again.
|
|
13453
|
+
//
|
|
13454
|
+
// Only attach a listener if one does not already exist for the lanes
|
|
13455
|
+
// we're currently rendering (which acts like a "thread ID" here).
|
|
13456
|
+
//
|
|
13457
|
+
// We only need to do this in concurrent mode. Legacy Suspense always
|
|
13458
|
+
// commits fallbacks synchronously, so there are no pings.
|
|
13459
|
+
if (suspenseBoundary.mode & ConcurrentMode) {
|
|
13460
|
+
var pingCache = root.pingCache;
|
|
13461
|
+
var threadIDs;
|
|
13462
|
+
|
|
13463
|
+
if (pingCache === null) {
|
|
13464
|
+
pingCache = root.pingCache = new PossiblyWeakMap$1();
|
|
12967
13465
|
threadIDs = new Set();
|
|
12968
13466
|
pingCache.set(wakeable, threadIDs);
|
|
13467
|
+
} else {
|
|
13468
|
+
threadIDs = pingCache.get(wakeable);
|
|
13469
|
+
|
|
13470
|
+
if (threadIDs === undefined) {
|
|
13471
|
+
threadIDs = new Set();
|
|
13472
|
+
pingCache.set(wakeable, threadIDs);
|
|
13473
|
+
}
|
|
12969
13474
|
}
|
|
12970
|
-
}
|
|
12971
13475
|
|
|
12972
|
-
|
|
12973
|
-
|
|
12974
|
-
|
|
12975
|
-
|
|
13476
|
+
if (!threadIDs.has(lanes)) {
|
|
13477
|
+
// Memoize using the thread ID to prevent redundant listeners.
|
|
13478
|
+
threadIDs.add(lanes);
|
|
13479
|
+
var ping = pingSuspendedRoot.bind(null, root, wakeable, lanes);
|
|
12976
13480
|
|
|
12977
|
-
|
|
12978
|
-
|
|
12979
|
-
|
|
12980
|
-
|
|
13481
|
+
{
|
|
13482
|
+
if (isDevToolsPresent) {
|
|
13483
|
+
// If we have pending work still, restore the original updaters
|
|
13484
|
+
restorePendingUpdaters(root, lanes);
|
|
13485
|
+
}
|
|
12981
13486
|
}
|
|
13487
|
+
|
|
13488
|
+
wakeable.then(ping, ping);
|
|
12982
13489
|
}
|
|
13490
|
+
} // Retry listener
|
|
13491
|
+
//
|
|
13492
|
+
// If the fallback does commit, we need to attach a different type of
|
|
13493
|
+
// listener. This one schedules an update on the Suspense boundary to turn
|
|
13494
|
+
// the fallback state off.
|
|
13495
|
+
//
|
|
13496
|
+
// Stash the wakeable on the boundary fiber so we can access it in the
|
|
13497
|
+
// commit phase.
|
|
13498
|
+
//
|
|
13499
|
+
// When the wakeable resolves, we'll attempt to render the boundary
|
|
13500
|
+
// again ("retry").
|
|
12983
13501
|
|
|
12984
|
-
|
|
13502
|
+
var wakeables = suspenseBoundary.updateQueue;
|
|
13503
|
+
|
|
13504
|
+
if (wakeables === null) {
|
|
13505
|
+
var updateQueue = new Set();
|
|
13506
|
+
updateQueue.add(wakeable);
|
|
13507
|
+
suspenseBoundary.updateQueue = updateQueue;
|
|
13508
|
+
} else {
|
|
13509
|
+
wakeables.add(wakeable);
|
|
12985
13510
|
}
|
|
12986
13511
|
}
|
|
12987
13512
|
|
|
12988
|
-
function
|
|
12989
|
-
|
|
12990
|
-
returnFiber,
|
|
12991
|
-
sourceFiber,
|
|
12992
|
-
value,
|
|
12993
|
-
rootRenderLanes
|
|
12994
|
-
) {
|
|
12995
|
-
// The source fiber did not complete.
|
|
12996
|
-
sourceFiber.flags |= Incomplete;
|
|
13513
|
+
function resetSuspendedComponent(sourceFiber, rootRenderLanes) {
|
|
13514
|
+
// A legacy mode Suspense quirk, only relevant to hook components.
|
|
12997
13515
|
|
|
12998
|
-
|
|
12999
|
-
if (isDevToolsPresent) {
|
|
13000
|
-
// If we have pending work still, restore the original updaters
|
|
13001
|
-
restorePendingUpdaters(root, rootRenderLanes);
|
|
13002
|
-
}
|
|
13003
|
-
}
|
|
13516
|
+
var tag = sourceFiber.tag;
|
|
13004
13517
|
|
|
13005
13518
|
if (
|
|
13006
|
-
|
|
13007
|
-
|
|
13008
|
-
|
|
13519
|
+
(sourceFiber.mode & ConcurrentMode) === NoMode &&
|
|
13520
|
+
(tag === FunctionComponent ||
|
|
13521
|
+
tag === ForwardRef ||
|
|
13522
|
+
tag === SimpleMemoComponent)
|
|
13009
13523
|
) {
|
|
13010
|
-
var
|
|
13011
|
-
// A legacy mode Suspense quirk, only relevant to hook components.
|
|
13012
|
-
|
|
13013
|
-
var tag = sourceFiber.tag;
|
|
13014
|
-
|
|
13015
|
-
if (
|
|
13016
|
-
(sourceFiber.mode & ConcurrentMode) === NoMode &&
|
|
13017
|
-
(tag === FunctionComponent ||
|
|
13018
|
-
tag === ForwardRef ||
|
|
13019
|
-
tag === SimpleMemoComponent)
|
|
13020
|
-
) {
|
|
13021
|
-
var currentSource = sourceFiber.alternate;
|
|
13524
|
+
var currentSource = sourceFiber.alternate;
|
|
13022
13525
|
|
|
13023
|
-
|
|
13024
|
-
|
|
13025
|
-
|
|
13026
|
-
|
|
13027
|
-
|
|
13028
|
-
|
|
13029
|
-
|
|
13030
|
-
}
|
|
13526
|
+
if (currentSource) {
|
|
13527
|
+
sourceFiber.updateQueue = currentSource.updateQueue;
|
|
13528
|
+
sourceFiber.memoizedState = currentSource.memoizedState;
|
|
13529
|
+
sourceFiber.lanes = currentSource.lanes;
|
|
13530
|
+
} else {
|
|
13531
|
+
sourceFiber.updateQueue = null;
|
|
13532
|
+
sourceFiber.memoizedState = null;
|
|
13031
13533
|
}
|
|
13534
|
+
}
|
|
13535
|
+
}
|
|
13032
13536
|
|
|
13033
|
-
|
|
13034
|
-
|
|
13035
|
-
|
|
13036
|
-
|
|
13537
|
+
function markNearestSuspenseBoundaryShouldCapture(
|
|
13538
|
+
returnFiber,
|
|
13539
|
+
sourceFiber,
|
|
13540
|
+
root,
|
|
13541
|
+
rootRenderLanes
|
|
13542
|
+
) {
|
|
13543
|
+
var hasInvisibleParentBoundary = hasSuspenseContext(
|
|
13544
|
+
suspenseStackCursor.current,
|
|
13545
|
+
InvisibleParentSuspenseContext
|
|
13546
|
+
);
|
|
13547
|
+
var node = returnFiber;
|
|
13037
13548
|
|
|
13038
|
-
|
|
13549
|
+
do {
|
|
13550
|
+
if (
|
|
13551
|
+
node.tag === SuspenseComponent &&
|
|
13552
|
+
shouldCaptureSuspense(node, hasInvisibleParentBoundary)
|
|
13553
|
+
) {
|
|
13554
|
+
// Found the nearest boundary.
|
|
13555
|
+
var suspenseBoundary = node; // This marks a Suspense boundary so that when we're unwinding the stack,
|
|
13556
|
+
// it captures the suspended "exception" and does a second (fallback) pass.
|
|
13039
13557
|
|
|
13040
|
-
|
|
13041
|
-
|
|
13042
|
-
_workInProgress.tag === SuspenseComponent &&
|
|
13043
|
-
shouldCaptureSuspense(_workInProgress, hasInvisibleParentBoundary)
|
|
13044
|
-
) {
|
|
13045
|
-
// Found the nearest boundary.
|
|
13046
|
-
// Stash the promise on the boundary fiber. If the boundary times out, we'll
|
|
13047
|
-
// attach another listener to flip the boundary back to its normal state.
|
|
13048
|
-
var wakeables = _workInProgress.updateQueue;
|
|
13049
|
-
|
|
13050
|
-
if (wakeables === null) {
|
|
13051
|
-
var updateQueue = new Set();
|
|
13052
|
-
updateQueue.add(wakeable);
|
|
13053
|
-
_workInProgress.updateQueue = updateQueue;
|
|
13054
|
-
} else {
|
|
13055
|
-
wakeables.add(wakeable);
|
|
13056
|
-
} // If the boundary is in legacy mode, we should *not*
|
|
13057
|
-
// suspend the commit. Pretend as if the suspended component rendered
|
|
13058
|
-
// null and keep rendering. In the commit phase, we'll schedule a
|
|
13059
|
-
// subsequent synchronous update to re-render the Suspense.
|
|
13060
|
-
//
|
|
13061
|
-
// Note: It doesn't matter whether the component that suspended was
|
|
13062
|
-
// inside a concurrent mode tree. If the Suspense is outside of it, we
|
|
13063
|
-
// should *not* suspend the commit.
|
|
13558
|
+
if ((suspenseBoundary.mode & ConcurrentMode) === NoMode) {
|
|
13559
|
+
// Legacy Mode Suspense
|
|
13064
13560
|
//
|
|
13065
|
-
// If the
|
|
13066
|
-
//
|
|
13067
|
-
//
|
|
13068
|
-
//
|
|
13069
|
-
|
|
13070
|
-
|
|
13071
|
-
|
|
13072
|
-
|
|
13073
|
-
|
|
13074
|
-
|
|
13561
|
+
// If the boundary is in legacy mode, we should *not*
|
|
13562
|
+
// suspend the commit. Pretend as if the suspended component rendered
|
|
13563
|
+
// null and keep rendering. When the Suspense boundary completes,
|
|
13564
|
+
// we'll do a second pass to render the fallback.
|
|
13565
|
+
if (suspenseBoundary === returnFiber) {
|
|
13566
|
+
// Special case where we suspended while reconciling the children of
|
|
13567
|
+
// a Suspense boundary's inner Offscreen wrapper fiber. This happens
|
|
13568
|
+
// when a React.lazy component is a direct child of a
|
|
13569
|
+
// Suspense boundary.
|
|
13570
|
+
//
|
|
13571
|
+
// Suspense boundaries are implemented as multiple fibers, but they
|
|
13572
|
+
// are a single conceptual unit. The legacy mode behavior where we
|
|
13573
|
+
// pretend the suspended fiber committed as `null` won't work,
|
|
13574
|
+
// because in this case the "suspended" fiber is the inner
|
|
13575
|
+
// Offscreen wrapper.
|
|
13576
|
+
//
|
|
13577
|
+
// Because the contents of the boundary haven't started rendering
|
|
13578
|
+
// yet (i.e. nothing in the tree has partially rendered) we can
|
|
13579
|
+
// switch to the regular, concurrent mode behavior: mark the
|
|
13580
|
+
// boundary with ShouldCapture and enter the unwind phase.
|
|
13581
|
+
suspenseBoundary.flags |= ShouldCapture;
|
|
13582
|
+
} else {
|
|
13583
|
+
suspenseBoundary.flags |= DidCapture;
|
|
13075
13584
|
sourceFiber.flags |= ForceUpdateForLegacySuspense; // We're going to commit this fiber even though it didn't complete.
|
|
13076
13585
|
// But we shouldn't call any lifecycle methods or callbacks. Remove
|
|
13077
13586
|
// all lifecycle effect tags.
|
|
@@ -13079,9 +13588,9 @@ function throwException(
|
|
|
13079
13588
|
sourceFiber.flags &= ~(LifecycleEffectMask | Incomplete);
|
|
13080
13589
|
|
|
13081
13590
|
if (sourceFiber.tag === ClassComponent) {
|
|
13082
|
-
var
|
|
13591
|
+
var currentSourceFiber = sourceFiber.alternate;
|
|
13083
13592
|
|
|
13084
|
-
if (
|
|
13593
|
+
if (currentSourceFiber === null) {
|
|
13085
13594
|
// This is a new mount. Change the tag so it's not mistaken for a
|
|
13086
13595
|
// completed class component. For example, we should not call
|
|
13087
13596
|
// componentWillUnmount if it is deleted.
|
|
@@ -13097,70 +13606,118 @@ function throwException(
|
|
|
13097
13606
|
} // The source fiber did not complete. Mark it with Sync priority to
|
|
13098
13607
|
// indicate that it still has pending work.
|
|
13099
13608
|
|
|
13100
|
-
sourceFiber.lanes = mergeLanes(sourceFiber.lanes, SyncLane);
|
|
13609
|
+
sourceFiber.lanes = mergeLanes(sourceFiber.lanes, SyncLane);
|
|
13610
|
+
}
|
|
13101
13611
|
|
|
13102
|
-
|
|
13103
|
-
|
|
13104
|
-
|
|
13105
|
-
|
|
13106
|
-
|
|
13107
|
-
|
|
13108
|
-
|
|
13109
|
-
|
|
13110
|
-
|
|
13111
|
-
|
|
13112
|
-
|
|
13113
|
-
|
|
13114
|
-
|
|
13115
|
-
|
|
13116
|
-
|
|
13117
|
-
|
|
13118
|
-
|
|
13119
|
-
|
|
13120
|
-
|
|
13121
|
-
|
|
13122
|
-
|
|
13123
|
-
|
|
13124
|
-
|
|
13125
|
-
|
|
13126
|
-
|
|
13127
|
-
|
|
13128
|
-
|
|
13129
|
-
|
|
13130
|
-
|
|
13131
|
-
|
|
13132
|
-
|
|
13133
|
-
|
|
13134
|
-
|
|
13135
|
-
|
|
13136
|
-
|
|
13137
|
-
|
|
13138
|
-
|
|
13139
|
-
|
|
13140
|
-
|
|
13141
|
-
|
|
13142
|
-
|
|
13612
|
+
return suspenseBoundary;
|
|
13613
|
+
} // Confirmed that the boundary is in a concurrent mode tree. Continue
|
|
13614
|
+
// with the normal suspend path.
|
|
13615
|
+
//
|
|
13616
|
+
// After this we'll use a set of heuristics to determine whether this
|
|
13617
|
+
// render pass will run to completion or restart or "suspend" the commit.
|
|
13618
|
+
// The actual logic for this is spread out in different places.
|
|
13619
|
+
//
|
|
13620
|
+
// This first principle is that if we're going to suspend when we complete
|
|
13621
|
+
// a root, then we should also restart if we get an update or ping that
|
|
13622
|
+
// might unsuspend it, and vice versa. The only reason to suspend is
|
|
13623
|
+
// because you think you might want to restart before committing. However,
|
|
13624
|
+
// it doesn't make sense to restart only while in the period we're suspended.
|
|
13625
|
+
//
|
|
13626
|
+
// Restarting too aggressively is also not good because it starves out any
|
|
13627
|
+
// intermediate loading state. So we use heuristics to determine when.
|
|
13628
|
+
// Suspense Heuristics
|
|
13629
|
+
//
|
|
13630
|
+
// If nothing threw a Promise or all the same fallbacks are already showing,
|
|
13631
|
+
// then don't suspend/restart.
|
|
13632
|
+
//
|
|
13633
|
+
// If this is an initial render of a new tree of Suspense boundaries and
|
|
13634
|
+
// those trigger a fallback, then don't suspend/restart. We want to ensure
|
|
13635
|
+
// that we can show the initial loading state as quickly as possible.
|
|
13636
|
+
//
|
|
13637
|
+
// If we hit a "Delayed" case, such as when we'd switch from content back into
|
|
13638
|
+
// a fallback, then we should always suspend/restart. Transitions apply
|
|
13639
|
+
// to this case. If none is defined, JND is used instead.
|
|
13640
|
+
//
|
|
13641
|
+
// If we're already showing a fallback and it gets "retried", allowing us to show
|
|
13642
|
+
// another level, but there's still an inner boundary that would show a fallback,
|
|
13643
|
+
// then we suspend/restart for 500ms since the last time we showed a fallback
|
|
13644
|
+
// anywhere in the tree. This effectively throttles progressive loading into a
|
|
13645
|
+
// consistent train of commits. This also gives us an opportunity to restart to
|
|
13646
|
+
// get to the completed state slightly earlier.
|
|
13647
|
+
//
|
|
13648
|
+
// If there's ambiguity due to batching it's resolved in preference of:
|
|
13649
|
+
// 1) "delayed", 2) "initial render", 3) "retry".
|
|
13650
|
+
//
|
|
13651
|
+
// We want to ensure that a "busy" state doesn't get force committed. We want to
|
|
13652
|
+
// ensure that new initial loading states can commit as soon as possible.
|
|
13143
13653
|
|
|
13144
|
-
|
|
13145
|
-
|
|
13146
|
-
// the begin phase to prevent an early bailout.
|
|
13654
|
+
suspenseBoundary.flags |= ShouldCapture; // TODO: I think we can remove this, since we now use `DidCapture` in
|
|
13655
|
+
// the begin phase to prevent an early bailout.
|
|
13147
13656
|
|
|
13148
|
-
|
|
13149
|
-
|
|
13150
|
-
|
|
13151
|
-
|
|
13657
|
+
suspenseBoundary.lanes = rootRenderLanes;
|
|
13658
|
+
return suspenseBoundary;
|
|
13659
|
+
} // This boundary already captured during this render. Continue to the next
|
|
13660
|
+
// boundary.
|
|
13661
|
+
|
|
13662
|
+
node = node.return;
|
|
13663
|
+
} while (node !== null); // Could not find a Suspense boundary capable of capturing.
|
|
13152
13664
|
|
|
13153
|
-
|
|
13154
|
-
|
|
13155
|
-
// TODO: Use invariant so the message is stripped in prod?
|
|
13665
|
+
return null;
|
|
13666
|
+
}
|
|
13156
13667
|
|
|
13157
|
-
|
|
13158
|
-
|
|
13159
|
-
|
|
13160
|
-
|
|
13161
|
-
|
|
13162
|
-
|
|
13668
|
+
function throwException(
|
|
13669
|
+
root,
|
|
13670
|
+
returnFiber,
|
|
13671
|
+
sourceFiber,
|
|
13672
|
+
value,
|
|
13673
|
+
rootRenderLanes
|
|
13674
|
+
) {
|
|
13675
|
+
// The source fiber did not complete.
|
|
13676
|
+
sourceFiber.flags |= Incomplete;
|
|
13677
|
+
|
|
13678
|
+
{
|
|
13679
|
+
if (isDevToolsPresent) {
|
|
13680
|
+
// If we have pending work still, restore the original updaters
|
|
13681
|
+
restorePendingUpdaters(root, rootRenderLanes);
|
|
13682
|
+
}
|
|
13683
|
+
}
|
|
13684
|
+
|
|
13685
|
+
if (
|
|
13686
|
+
value !== null &&
|
|
13687
|
+
typeof value === "object" &&
|
|
13688
|
+
typeof value.then === "function"
|
|
13689
|
+
) {
|
|
13690
|
+
// This is a wakeable. The component suspended.
|
|
13691
|
+
var wakeable = value;
|
|
13692
|
+
resetSuspendedComponent(sourceFiber);
|
|
13693
|
+
|
|
13694
|
+
var suspenseBoundary = markNearestSuspenseBoundaryShouldCapture(
|
|
13695
|
+
returnFiber,
|
|
13696
|
+
sourceFiber,
|
|
13697
|
+
root,
|
|
13698
|
+
rootRenderLanes
|
|
13163
13699
|
);
|
|
13700
|
+
|
|
13701
|
+
if (suspenseBoundary !== null) {
|
|
13702
|
+
attachWakeableListeners(
|
|
13703
|
+
suspenseBoundary,
|
|
13704
|
+
root,
|
|
13705
|
+
wakeable,
|
|
13706
|
+
rootRenderLanes
|
|
13707
|
+
);
|
|
13708
|
+
return;
|
|
13709
|
+
} else {
|
|
13710
|
+
// No boundary was found. Fallthrough to error mode.
|
|
13711
|
+
// TODO: We should never call getComponentNameFromFiber in production.
|
|
13712
|
+
// Log a warning or something to prevent us from accidentally bundling it.
|
|
13713
|
+
value = new Error(
|
|
13714
|
+
(getComponentNameFromFiber(sourceFiber) || "A React component") +
|
|
13715
|
+
" suspended while rendering, but no fallback UI was specified.\n" +
|
|
13716
|
+
"\n" +
|
|
13717
|
+
"Add a <Suspense fallback=...> component higher in the tree to " +
|
|
13718
|
+
"provide a loading indicator or placeholder to display."
|
|
13719
|
+
);
|
|
13720
|
+
}
|
|
13164
13721
|
} // We didn't find a boundary that could handle this type of exception. Start
|
|
13165
13722
|
// over and traverse parent path again, this time treating the exception
|
|
13166
13723
|
// as an error.
|
|
@@ -13176,10 +13733,8 @@ function throwException(
|
|
|
13176
13733
|
workInProgress.flags |= ShouldCapture;
|
|
13177
13734
|
var lane = pickArbitraryLane(rootRenderLanes);
|
|
13178
13735
|
workInProgress.lanes = mergeLanes(workInProgress.lanes, lane);
|
|
13179
|
-
|
|
13180
|
-
|
|
13181
|
-
|
|
13182
|
-
enqueueCapturedUpdate(workInProgress, _update);
|
|
13736
|
+
var update = createRootErrorUpdate(workInProgress, _errorInfo, lane);
|
|
13737
|
+
enqueueCapturedUpdate(workInProgress, update);
|
|
13183
13738
|
return;
|
|
13184
13739
|
}
|
|
13185
13740
|
|
|
@@ -13202,13 +13757,13 @@ function throwException(
|
|
|
13202
13757
|
|
|
13203
13758
|
workInProgress.lanes = mergeLanes(workInProgress.lanes, _lane); // Schedule the error boundary to re-render using updated state
|
|
13204
13759
|
|
|
13205
|
-
var
|
|
13760
|
+
var _update = createClassErrorUpdate(
|
|
13206
13761
|
workInProgress,
|
|
13207
13762
|
errorInfo,
|
|
13208
13763
|
_lane
|
|
13209
13764
|
);
|
|
13210
13765
|
|
|
13211
|
-
enqueueCapturedUpdate(workInProgress,
|
|
13766
|
+
enqueueCapturedUpdate(workInProgress, _update);
|
|
13212
13767
|
return;
|
|
13213
13768
|
}
|
|
13214
13769
|
|
|
@@ -13595,7 +14150,7 @@ function completeWork(current, workInProgress, renderLanes) {
|
|
|
13595
14150
|
// If we hydrated, then we'll need to schedule an update for
|
|
13596
14151
|
// the commit side-effects on the root.
|
|
13597
14152
|
markUpdate(workInProgress);
|
|
13598
|
-
} else if (!fiberRoot.
|
|
14153
|
+
} else if (!fiberRoot.isDehydrated) {
|
|
13599
14154
|
// Schedule an effect to clear this container at the start of the next commit.
|
|
13600
14155
|
// This handles the case of React rendering into a container with previous children.
|
|
13601
14156
|
// It's also safe to do for updates too, because current.child would only be null
|
|
@@ -13628,9 +14183,10 @@ function completeWork(current, workInProgress, renderLanes) {
|
|
|
13628
14183
|
}
|
|
13629
14184
|
} else {
|
|
13630
14185
|
if (!newProps) {
|
|
13631
|
-
if (
|
|
13632
|
-
throw Error(
|
|
13633
|
-
"We must have new props for new mounts. This error is likely
|
|
14186
|
+
if (workInProgress.stateNode === null) {
|
|
14187
|
+
throw new Error(
|
|
14188
|
+
"We must have new props for new mounts. This error is likely " +
|
|
14189
|
+
"caused by a bug in React. Please file an issue."
|
|
13634
14190
|
);
|
|
13635
14191
|
} // This can happen when we abort work.
|
|
13636
14192
|
|
|
@@ -13691,9 +14247,10 @@ function completeWork(current, workInProgress, renderLanes) {
|
|
|
13691
14247
|
updateHostText(current, workInProgress, oldText, newText);
|
|
13692
14248
|
} else {
|
|
13693
14249
|
if (typeof newText !== "string") {
|
|
13694
|
-
if (
|
|
13695
|
-
throw Error(
|
|
13696
|
-
"We must have new props for new mounts. This error is likely
|
|
14250
|
+
if (workInProgress.stateNode === null) {
|
|
14251
|
+
throw new Error(
|
|
14252
|
+
"We must have new props for new mounts. This error is likely " +
|
|
14253
|
+
"caused by a bug in React. Please file an issue."
|
|
13697
14254
|
);
|
|
13698
14255
|
} // This can happen when we abort work.
|
|
13699
14256
|
}
|
|
@@ -14110,13 +14667,12 @@ function completeWork(current, workInProgress, renderLanes) {
|
|
|
14110
14667
|
}
|
|
14111
14668
|
}
|
|
14112
14669
|
|
|
14113
|
-
|
|
14114
|
-
|
|
14115
|
-
|
|
14116
|
-
|
|
14117
|
-
|
|
14118
|
-
|
|
14119
|
-
}
|
|
14670
|
+
throw new Error(
|
|
14671
|
+
"Unknown unit of work tag (" +
|
|
14672
|
+
workInProgress.tag +
|
|
14673
|
+
"). This error is likely caused by a bug in " +
|
|
14674
|
+
"React. Please file an issue."
|
|
14675
|
+
);
|
|
14120
14676
|
}
|
|
14121
14677
|
|
|
14122
14678
|
var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;
|
|
@@ -14246,7 +14802,7 @@ function updateForwardRef(
|
|
|
14246
14802
|
);
|
|
14247
14803
|
|
|
14248
14804
|
if (workInProgress.mode & StrictLegacyMode) {
|
|
14249
|
-
|
|
14805
|
+
setIsStrictModeForDevtools(true);
|
|
14250
14806
|
|
|
14251
14807
|
try {
|
|
14252
14808
|
nextChildren = renderWithHooks(
|
|
@@ -14258,7 +14814,7 @@ function updateForwardRef(
|
|
|
14258
14814
|
renderLanes
|
|
14259
14815
|
);
|
|
14260
14816
|
} finally {
|
|
14261
|
-
|
|
14817
|
+
setIsStrictModeForDevtools(false);
|
|
14262
14818
|
}
|
|
14263
14819
|
}
|
|
14264
14820
|
|
|
@@ -14706,7 +15262,7 @@ function updateFunctionComponent(
|
|
|
14706
15262
|
);
|
|
14707
15263
|
|
|
14708
15264
|
if (workInProgress.mode & StrictLegacyMode) {
|
|
14709
|
-
|
|
15265
|
+
setIsStrictModeForDevtools(true);
|
|
14710
15266
|
|
|
14711
15267
|
try {
|
|
14712
15268
|
nextChildren = renderWithHooks(
|
|
@@ -14718,7 +15274,7 @@ function updateFunctionComponent(
|
|
|
14718
15274
|
renderLanes
|
|
14719
15275
|
);
|
|
14720
15276
|
} finally {
|
|
14721
|
-
|
|
15277
|
+
setIsStrictModeForDevtools(false);
|
|
14722
15278
|
}
|
|
14723
15279
|
}
|
|
14724
15280
|
|
|
@@ -14763,7 +15319,8 @@ function updateClassComponent(
|
|
|
14763
15319
|
|
|
14764
15320
|
case true: {
|
|
14765
15321
|
workInProgress.flags |= DidCapture;
|
|
14766
|
-
workInProgress.flags |= ShouldCapture;
|
|
15322
|
+
workInProgress.flags |= ShouldCapture; // eslint-disable-next-line react-internal/prod-error-codes
|
|
15323
|
+
|
|
14767
15324
|
var error$1 = new Error("Simulated error coming from DevTools");
|
|
14768
15325
|
var lane = pickArbitraryLane(renderLanes);
|
|
14769
15326
|
workInProgress.lanes = mergeLanes(workInProgress.lanes, lane); // Schedule the error boundary to re-render using updated state
|
|
@@ -14916,12 +15473,12 @@ function finishClassComponent(
|
|
|
14916
15473
|
nextChildren = instance.render();
|
|
14917
15474
|
|
|
14918
15475
|
if (workInProgress.mode & StrictLegacyMode) {
|
|
14919
|
-
|
|
15476
|
+
setIsStrictModeForDevtools(true);
|
|
14920
15477
|
|
|
14921
15478
|
try {
|
|
14922
15479
|
instance.render();
|
|
14923
15480
|
} finally {
|
|
14924
|
-
|
|
15481
|
+
setIsStrictModeForDevtools(false);
|
|
14925
15482
|
}
|
|
14926
15483
|
}
|
|
14927
15484
|
|
|
@@ -14977,9 +15534,11 @@ function updateHostRoot(current, workInProgress, renderLanes) {
|
|
|
14977
15534
|
pushHostRootContext(workInProgress);
|
|
14978
15535
|
var updateQueue = workInProgress.updateQueue;
|
|
14979
15536
|
|
|
14980
|
-
if (
|
|
14981
|
-
throw Error(
|
|
14982
|
-
"If the root does not have an updateQueue, we should have already
|
|
15537
|
+
if (current === null || updateQueue === null) {
|
|
15538
|
+
throw new Error(
|
|
15539
|
+
"If the root does not have an updateQueue, we should have already " +
|
|
15540
|
+
"bailed out. This error is likely caused by a bug in React. Please " +
|
|
15541
|
+
"file an issue."
|
|
14983
15542
|
);
|
|
14984
15543
|
}
|
|
14985
15544
|
|
|
@@ -14998,7 +15557,7 @@ function updateHostRoot(current, workInProgress, renderLanes) {
|
|
|
14998
15557
|
return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes);
|
|
14999
15558
|
}
|
|
15000
15559
|
|
|
15001
|
-
if (root.
|
|
15560
|
+
if (root.isDehydrated && enterHydrationState()) {
|
|
15002
15561
|
var child = mountChildFibers(
|
|
15003
15562
|
workInProgress,
|
|
15004
15563
|
null,
|
|
@@ -15174,14 +15733,12 @@ function mountLazyComponent(
|
|
|
15174
15733
|
// because the fact that it's a separate type of work is an
|
|
15175
15734
|
// implementation detail.
|
|
15176
15735
|
|
|
15177
|
-
|
|
15178
|
-
|
|
15179
|
-
|
|
15180
|
-
|
|
15181
|
-
|
|
15182
|
-
|
|
15183
|
-
);
|
|
15184
|
-
}
|
|
15736
|
+
throw new Error(
|
|
15737
|
+
"Element type is invalid. Received a promise that resolves to: " +
|
|
15738
|
+
Component +
|
|
15739
|
+
". " +
|
|
15740
|
+
("Lazy element type must resolve to a class or function." + hint)
|
|
15741
|
+
);
|
|
15185
15742
|
}
|
|
15186
15743
|
|
|
15187
15744
|
function mountIncompleteClassComponent(
|
|
@@ -15385,7 +15942,7 @@ function mountIndeterminateComponent(
|
|
|
15385
15942
|
|
|
15386
15943
|
{
|
|
15387
15944
|
if (workInProgress.mode & StrictLegacyMode) {
|
|
15388
|
-
|
|
15945
|
+
setIsStrictModeForDevtools(true);
|
|
15389
15946
|
|
|
15390
15947
|
try {
|
|
15391
15948
|
value = renderWithHooks(
|
|
@@ -15397,7 +15954,7 @@ function mountIndeterminateComponent(
|
|
|
15397
15954
|
renderLanes
|
|
15398
15955
|
);
|
|
15399
15956
|
} finally {
|
|
15400
|
-
|
|
15957
|
+
setIsStrictModeForDevtools(false);
|
|
15401
15958
|
}
|
|
15402
15959
|
}
|
|
15403
15960
|
}
|
|
@@ -16557,6 +17114,7 @@ function remountFiber(current, oldWorkInProgress, newWorkInProgress) {
|
|
|
16557
17114
|
var returnFiber = oldWorkInProgress.return;
|
|
16558
17115
|
|
|
16559
17116
|
if (returnFiber === null) {
|
|
17117
|
+
// eslint-disable-next-line react-internal/prod-error-codes
|
|
16560
17118
|
throw new Error("Cannot swap the root fiber.");
|
|
16561
17119
|
} // Disconnect from the old current.
|
|
16562
17120
|
// It will get deleted.
|
|
@@ -16575,6 +17133,7 @@ function remountFiber(current, oldWorkInProgress, newWorkInProgress) {
|
|
|
16575
17133
|
var prevSibling = returnFiber.child;
|
|
16576
17134
|
|
|
16577
17135
|
if (prevSibling === null) {
|
|
17136
|
+
// eslint-disable-next-line react-internal/prod-error-codes
|
|
16578
17137
|
throw new Error("Expected parent to have a child.");
|
|
16579
17138
|
}
|
|
16580
17139
|
|
|
@@ -16582,6 +17141,7 @@ function remountFiber(current, oldWorkInProgress, newWorkInProgress) {
|
|
|
16582
17141
|
prevSibling = prevSibling.sibling;
|
|
16583
17142
|
|
|
16584
17143
|
if (prevSibling === null) {
|
|
17144
|
+
// eslint-disable-next-line react-internal/prod-error-codes
|
|
16585
17145
|
throw new Error("Expected to find the previous sibling.");
|
|
16586
17146
|
}
|
|
16587
17147
|
}
|
|
@@ -17051,13 +17611,12 @@ function beginWork(current, workInProgress, renderLanes) {
|
|
|
17051
17611
|
}
|
|
17052
17612
|
}
|
|
17053
17613
|
|
|
17054
|
-
|
|
17055
|
-
|
|
17056
|
-
|
|
17057
|
-
|
|
17058
|
-
|
|
17059
|
-
|
|
17060
|
-
}
|
|
17614
|
+
throw new Error(
|
|
17615
|
+
"Unknown unit of work tag (" +
|
|
17616
|
+
workInProgress.tag +
|
|
17617
|
+
"). This error is likely caused by a bug in " +
|
|
17618
|
+
"React. Please file an issue."
|
|
17619
|
+
);
|
|
17061
17620
|
}
|
|
17062
17621
|
|
|
17063
17622
|
function unwindWork(workInProgress, renderLanes) {
|
|
@@ -17090,9 +17649,10 @@ function unwindWork(workInProgress, renderLanes) {
|
|
|
17090
17649
|
resetWorkInProgressVersions();
|
|
17091
17650
|
var _flags = workInProgress.flags;
|
|
17092
17651
|
|
|
17093
|
-
if (
|
|
17094
|
-
throw Error(
|
|
17095
|
-
"The root failed to unmount after an error. This is likely a bug in
|
|
17652
|
+
if ((_flags & DidCapture) !== NoFlags) {
|
|
17653
|
+
throw new Error(
|
|
17654
|
+
"The root failed to unmount after an error. This is likely a bug in " +
|
|
17655
|
+
"React. Please file an issue."
|
|
17096
17656
|
);
|
|
17097
17657
|
}
|
|
17098
17658
|
|
|
@@ -17262,6 +17822,8 @@ function safelyDetachRef(current, nearestMountedAncestor) {
|
|
|
17262
17822
|
|
|
17263
17823
|
if (ref !== null) {
|
|
17264
17824
|
if (typeof ref === "function") {
|
|
17825
|
+
var retVal;
|
|
17826
|
+
|
|
17265
17827
|
try {
|
|
17266
17828
|
if (
|
|
17267
17829
|
enableProfilerTimer &&
|
|
@@ -17270,12 +17832,12 @@ function safelyDetachRef(current, nearestMountedAncestor) {
|
|
|
17270
17832
|
) {
|
|
17271
17833
|
try {
|
|
17272
17834
|
startLayoutEffectTimer();
|
|
17273
|
-
ref(null);
|
|
17835
|
+
retVal = ref(null);
|
|
17274
17836
|
} finally {
|
|
17275
17837
|
recordLayoutEffectDuration(current);
|
|
17276
17838
|
}
|
|
17277
17839
|
} else {
|
|
17278
|
-
ref(null);
|
|
17840
|
+
retVal = ref(null);
|
|
17279
17841
|
}
|
|
17280
17842
|
} catch (error) {
|
|
17281
17843
|
reportUncaughtErrorInDEV(error);
|
|
@@ -17447,11 +18009,10 @@ function commitBeforeMutationEffectsOnFiber(finishedWork) {
|
|
|
17447
18009
|
break;
|
|
17448
18010
|
|
|
17449
18011
|
default: {
|
|
17450
|
-
|
|
17451
|
-
|
|
17452
|
-
"
|
|
17453
|
-
|
|
17454
|
-
}
|
|
18012
|
+
throw new Error(
|
|
18013
|
+
"This unit of work tag should not have side-effects. This error is " +
|
|
18014
|
+
"likely caused by a bug in React. Please file an issue."
|
|
18015
|
+
);
|
|
17455
18016
|
}
|
|
17456
18017
|
}
|
|
17457
18018
|
|
|
@@ -17505,6 +18066,16 @@ function commitHookEffectListMount(tag, finishedWork) {
|
|
|
17505
18066
|
var destroy = effect.destroy;
|
|
17506
18067
|
|
|
17507
18068
|
if (destroy !== undefined && typeof destroy !== "function") {
|
|
18069
|
+
var hookName = void 0;
|
|
18070
|
+
|
|
18071
|
+
if ((effect.tag & Layout) !== NoFlags) {
|
|
18072
|
+
hookName = "useLayoutEffect";
|
|
18073
|
+
} else if ((effect.tag & Insertion) !== NoFlags) {
|
|
18074
|
+
hookName = "useInsertionEffect";
|
|
18075
|
+
} else {
|
|
18076
|
+
hookName = "useEffect";
|
|
18077
|
+
}
|
|
18078
|
+
|
|
17508
18079
|
var addendum = void 0;
|
|
17509
18080
|
|
|
17510
18081
|
if (destroy === null) {
|
|
@@ -17513,10 +18084,13 @@ function commitHookEffectListMount(tag, finishedWork) {
|
|
|
17513
18084
|
"up, return undefined (or nothing).";
|
|
17514
18085
|
} else if (typeof destroy.then === "function") {
|
|
17515
18086
|
addendum =
|
|
17516
|
-
"\n\nIt looks like you wrote
|
|
18087
|
+
"\n\nIt looks like you wrote " +
|
|
18088
|
+
hookName +
|
|
18089
|
+
"(async () => ...) or returned a Promise. " +
|
|
17517
18090
|
"Instead, write the async function inside your effect " +
|
|
17518
18091
|
"and call it immediately:\n\n" +
|
|
17519
|
-
|
|
18092
|
+
hookName +
|
|
18093
|
+
"(() => {\n" +
|
|
17520
18094
|
" async function fetchData() {\n" +
|
|
17521
18095
|
" // You can await here\n" +
|
|
17522
18096
|
" const response = await MyAPI.getData(someId);\n" +
|
|
@@ -17530,8 +18104,9 @@ function commitHookEffectListMount(tag, finishedWork) {
|
|
|
17530
18104
|
}
|
|
17531
18105
|
|
|
17532
18106
|
error(
|
|
17533
|
-
"
|
|
18107
|
+
"%s must not return anything besides a function, " +
|
|
17534
18108
|
"which is used for clean-up.%s",
|
|
18109
|
+
hookName,
|
|
17535
18110
|
addendum
|
|
17536
18111
|
);
|
|
17537
18112
|
}
|
|
@@ -17903,11 +18478,11 @@ function commitLayoutEffectOnFiber(
|
|
|
17903
18478
|
case LegacyHiddenComponent:
|
|
17904
18479
|
break;
|
|
17905
18480
|
|
|
17906
|
-
default:
|
|
17907
|
-
throw Error(
|
|
17908
|
-
"This unit of work tag should not have side-effects. This error is
|
|
18481
|
+
default:
|
|
18482
|
+
throw new Error(
|
|
18483
|
+
"This unit of work tag should not have side-effects. This error is " +
|
|
18484
|
+
"likely caused by a bug in React. Please file an issue."
|
|
17909
18485
|
);
|
|
17910
|
-
}
|
|
17911
18486
|
}
|
|
17912
18487
|
}
|
|
17913
18488
|
|
|
@@ -18006,15 +18581,17 @@ function commitAttachRef(finishedWork) {
|
|
|
18006
18581
|
} // Moved outside to ensure DCE works with this flag
|
|
18007
18582
|
|
|
18008
18583
|
if (typeof ref === "function") {
|
|
18584
|
+
var retVal;
|
|
18585
|
+
|
|
18009
18586
|
if (finishedWork.mode & ProfileMode) {
|
|
18010
18587
|
try {
|
|
18011
18588
|
startLayoutEffectTimer();
|
|
18012
|
-
ref(instanceToUse);
|
|
18589
|
+
retVal = ref(instanceToUse);
|
|
18013
18590
|
} finally {
|
|
18014
18591
|
recordLayoutEffectDuration(finishedWork);
|
|
18015
18592
|
}
|
|
18016
18593
|
} else {
|
|
18017
|
-
ref(instanceToUse);
|
|
18594
|
+
retVal = ref(instanceToUse);
|
|
18018
18595
|
}
|
|
18019
18596
|
} else {
|
|
18020
18597
|
{
|
|
@@ -18078,7 +18655,10 @@ function commitUnmount(finishedRoot, current, nearestMountedAncestor) {
|
|
|
18078
18655
|
tag = _effect.tag;
|
|
18079
18656
|
|
|
18080
18657
|
if (destroy !== undefined) {
|
|
18081
|
-
if (
|
|
18658
|
+
if (
|
|
18659
|
+
(tag & Insertion) !== NoFlags$1 ||
|
|
18660
|
+
(tag & Layout) !== NoFlags$1
|
|
18661
|
+
) {
|
|
18082
18662
|
if (current.mode & ProfileMode) {
|
|
18083
18663
|
startLayoutEffectTimer();
|
|
18084
18664
|
safelyCallDestroy(current, nearestMountedAncestor, destroy);
|
|
@@ -18271,11 +18851,10 @@ function getHostParentFiber(fiber) {
|
|
|
18271
18851
|
parent = parent.return;
|
|
18272
18852
|
}
|
|
18273
18853
|
|
|
18274
|
-
|
|
18275
|
-
|
|
18276
|
-
"
|
|
18277
|
-
|
|
18278
|
-
}
|
|
18854
|
+
throw new Error(
|
|
18855
|
+
"Expected to find a host parent. This error is likely caused by a bug " +
|
|
18856
|
+
"in React. Please file an issue."
|
|
18857
|
+
);
|
|
18279
18858
|
}
|
|
18280
18859
|
|
|
18281
18860
|
function isHostParent(fiber) {
|
|
@@ -18360,11 +18939,11 @@ function commitPlacement(finishedWork) {
|
|
|
18360
18939
|
break;
|
|
18361
18940
|
// eslint-disable-next-line-no-fallthrough
|
|
18362
18941
|
|
|
18363
|
-
default:
|
|
18364
|
-
throw Error(
|
|
18365
|
-
"Invalid host parent fiber. This error is likely caused by a bug
|
|
18942
|
+
default:
|
|
18943
|
+
throw new Error(
|
|
18944
|
+
"Invalid host parent fiber. This error is likely caused by a bug " +
|
|
18945
|
+
"in React. Please file an issue."
|
|
18366
18946
|
);
|
|
18367
|
-
}
|
|
18368
18947
|
}
|
|
18369
18948
|
|
|
18370
18949
|
if (parentFiber.flags & ContentReset) {
|
|
@@ -18453,9 +19032,10 @@ function unmountHostComponents(finishedRoot, current, nearestMountedAncestor) {
|
|
|
18453
19032
|
var parent = node.return;
|
|
18454
19033
|
|
|
18455
19034
|
findParent: while (true) {
|
|
18456
|
-
if (
|
|
18457
|
-
throw Error(
|
|
18458
|
-
"Expected to find a host parent. This error is likely caused by
|
|
19035
|
+
if (parent === null) {
|
|
19036
|
+
throw new Error(
|
|
19037
|
+
"Expected to find a host parent. This error is likely caused by " +
|
|
19038
|
+
"a bug in React. Please file an issue."
|
|
18459
19039
|
);
|
|
18460
19040
|
}
|
|
18461
19041
|
|
|
@@ -18553,11 +19133,17 @@ function commitWork(current, finishedWork) {
|
|
|
18553
19133
|
case ForwardRef:
|
|
18554
19134
|
case MemoComponent:
|
|
18555
19135
|
case SimpleMemoComponent: {
|
|
18556
|
-
|
|
19136
|
+
commitHookEffectListUnmount(
|
|
19137
|
+
Insertion | HasEffect,
|
|
19138
|
+
finishedWork,
|
|
19139
|
+
finishedWork.return
|
|
19140
|
+
);
|
|
19141
|
+
commitHookEffectListMount(Insertion | HasEffect, finishedWork); // Layout effects are destroyed during the mutation phase so that all
|
|
18557
19142
|
// destroy functions for all fibers are called before any create functions.
|
|
18558
19143
|
// This prevents sibling component effects from interfering with each other,
|
|
18559
19144
|
// e.g. a destroy function in one component should never override a ref set
|
|
18560
19145
|
// by a create function in another component during the same commit.
|
|
19146
|
+
|
|
18561
19147
|
if (finishedWork.mode & ProfileMode) {
|
|
18562
19148
|
try {
|
|
18563
19149
|
startLayoutEffectTimer();
|
|
@@ -18608,9 +19194,10 @@ function commitWork(current, finishedWork) {
|
|
|
18608
19194
|
}
|
|
18609
19195
|
|
|
18610
19196
|
case HostText: {
|
|
18611
|
-
if (
|
|
18612
|
-
throw Error(
|
|
18613
|
-
"This should have a text node initialized. This error is likely
|
|
19197
|
+
if (finishedWork.stateNode === null) {
|
|
19198
|
+
throw new Error(
|
|
19199
|
+
"This should have a text node initialized. This error is likely " +
|
|
19200
|
+
"caused by a bug in React. Please file an issue."
|
|
18614
19201
|
);
|
|
18615
19202
|
}
|
|
18616
19203
|
|
|
@@ -18648,11 +19235,10 @@ function commitWork(current, finishedWork) {
|
|
|
18648
19235
|
}
|
|
18649
19236
|
}
|
|
18650
19237
|
|
|
18651
|
-
|
|
18652
|
-
|
|
18653
|
-
"
|
|
18654
|
-
|
|
18655
|
-
}
|
|
19238
|
+
throw new Error(
|
|
19239
|
+
"This unit of work tag should not have side-effects. This error is " +
|
|
19240
|
+
"likely caused by a bug in React. Please file an issue."
|
|
19241
|
+
);
|
|
18656
19242
|
}
|
|
18657
19243
|
|
|
18658
19244
|
function commitSuspenseCallback(finishedWork) {
|
|
@@ -19479,13 +20065,13 @@ function requestUpdateLane(fiber) {
|
|
|
19479
20065
|
var isTransition = requestCurrentTransition() !== NoTransition;
|
|
19480
20066
|
|
|
19481
20067
|
if (isTransition) {
|
|
19482
|
-
// The algorithm for assigning an update to a lane should be stable for all
|
|
19483
20068
|
// updates at the same priority within the same event. To do this, the
|
|
19484
20069
|
// inputs to the algorithm must be the same.
|
|
19485
20070
|
//
|
|
19486
20071
|
// The trick we use is to cache the first of each of these inputs within an
|
|
19487
20072
|
// event. Then reset the cached values once we can be sure the event is
|
|
19488
20073
|
// over. Our heuristic for that is whenever we enter a concurrent work loop.
|
|
20074
|
+
|
|
19489
20075
|
if (currentEventTransitionLane === NoLane) {
|
|
19490
20076
|
// All transitions within the same event are assigned the same lane.
|
|
19491
20077
|
currentEventTransitionLane = claimNextTransitionLane();
|
|
@@ -19780,8 +20366,8 @@ function performConcurrentWorkOnRoot(root, didTimeout) {
|
|
|
19780
20366
|
currentEventTime = NoTimestamp;
|
|
19781
20367
|
currentEventTransitionLane = NoLanes;
|
|
19782
20368
|
|
|
19783
|
-
if (
|
|
19784
|
-
throw Error("Should not already be working.");
|
|
20369
|
+
if ((executionContext & (RenderContext | CommitContext)) !== NoContext) {
|
|
20370
|
+
throw new Error("Should not already be working.");
|
|
19785
20371
|
} // Flush any pending passive effects before deciding which lanes to work on,
|
|
19786
20372
|
// in case they schedule additional work.
|
|
19787
20373
|
|
|
@@ -19815,38 +20401,26 @@ function performConcurrentWorkOnRoot(root, didTimeout) {
|
|
|
19815
20401
|
// bug we're still investigating. Once the bug in Scheduler is fixed,
|
|
19816
20402
|
// we can remove this, since we track expiration ourselves.
|
|
19817
20403
|
|
|
19818
|
-
var
|
|
19819
|
-
|
|
19820
|
-
|
|
19821
|
-
|
|
20404
|
+
var shouldTimeSlice =
|
|
20405
|
+
!includesBlockingLane(root, lanes) &&
|
|
20406
|
+
!includesExpiredLane(root, lanes) &&
|
|
20407
|
+
!didTimeout;
|
|
20408
|
+
var exitStatus = shouldTimeSlice
|
|
20409
|
+
? renderRootConcurrent(root, lanes)
|
|
20410
|
+
: renderRootSync(root, lanes);
|
|
19822
20411
|
|
|
19823
20412
|
if (exitStatus !== RootIncomplete) {
|
|
19824
20413
|
if (exitStatus === RootErrored) {
|
|
19825
|
-
|
|
19826
|
-
|
|
19827
|
-
//
|
|
19828
|
-
|
|
19829
|
-
if (root.hydrate) {
|
|
19830
|
-
root.hydrate = false;
|
|
19831
|
-
|
|
19832
|
-
{
|
|
19833
|
-
errorHydratingContainer(root.containerInfo);
|
|
19834
|
-
}
|
|
19835
|
-
|
|
19836
|
-
clearContainer(root.containerInfo);
|
|
19837
|
-
} // If something threw an error, try rendering one more time. We'll render
|
|
19838
|
-
// synchronously to block concurrent data mutations, and we'll includes
|
|
19839
|
-
// all pending updates are included. If it still fails after the second
|
|
19840
|
-
// attempt, we'll give up and commit the resulting tree.
|
|
19841
|
-
|
|
20414
|
+
// If something threw an error, try rendering one more time. We'll
|
|
20415
|
+
// render synchronously to block concurrent data mutations, and we'll
|
|
20416
|
+
// includes all pending updates are included. If it still fails after
|
|
20417
|
+
// the second attempt, we'll give up and commit the resulting tree.
|
|
19842
20418
|
var errorRetryLanes = getLanesToRetrySynchronouslyOnError(root);
|
|
19843
20419
|
|
|
19844
20420
|
if (errorRetryLanes !== NoLanes) {
|
|
19845
20421
|
lanes = errorRetryLanes;
|
|
19846
|
-
exitStatus =
|
|
20422
|
+
exitStatus = recoverFromConcurrentError(root, errorRetryLanes);
|
|
19847
20423
|
}
|
|
19848
|
-
|
|
19849
|
-
executionContext = prevExecutionContext;
|
|
19850
20424
|
}
|
|
19851
20425
|
|
|
19852
20426
|
if (exitStatus === RootFatalErrored) {
|
|
@@ -19855,10 +20429,43 @@ function performConcurrentWorkOnRoot(root, didTimeout) {
|
|
|
19855
20429
|
markRootSuspended$1(root, lanes);
|
|
19856
20430
|
ensureRootIsScheduled(root, now());
|
|
19857
20431
|
throw fatalError;
|
|
20432
|
+
} // Check if this render may have yielded to a concurrent event, and if so,
|
|
20433
|
+
// confirm that any newly rendered stores are consistent.
|
|
20434
|
+
// TODO: It's possible that even a concurrent render may never have yielded
|
|
20435
|
+
// to the main thread, if it was fast enough, or if it expired. We could
|
|
20436
|
+
// skip the consistency check in that case, too.
|
|
20437
|
+
|
|
20438
|
+
var renderWasConcurrent = !includesBlockingLane(root, lanes);
|
|
20439
|
+
var finishedWork = root.current.alternate;
|
|
20440
|
+
|
|
20441
|
+
if (
|
|
20442
|
+
renderWasConcurrent &&
|
|
20443
|
+
!isRenderConsistentWithExternalStores(finishedWork)
|
|
20444
|
+
) {
|
|
20445
|
+
// A store was mutated in an interleaved event. Render again,
|
|
20446
|
+
// synchronously, to block further mutations.
|
|
20447
|
+
exitStatus = renderRootSync(root, lanes); // We need to check again if something threw
|
|
20448
|
+
|
|
20449
|
+
if (exitStatus === RootErrored) {
|
|
20450
|
+
var _errorRetryLanes = getLanesToRetrySynchronouslyOnError(root);
|
|
20451
|
+
|
|
20452
|
+
if (_errorRetryLanes !== NoLanes) {
|
|
20453
|
+
lanes = _errorRetryLanes;
|
|
20454
|
+
exitStatus = recoverFromConcurrentError(root, _errorRetryLanes); // We assume the tree is now consistent because we didn't yield to any
|
|
20455
|
+
// concurrent events.
|
|
20456
|
+
}
|
|
20457
|
+
}
|
|
20458
|
+
|
|
20459
|
+
if (exitStatus === RootFatalErrored) {
|
|
20460
|
+
var _fatalError = workInProgressRootFatalError;
|
|
20461
|
+
prepareFreshStack(root, NoLanes);
|
|
20462
|
+
markRootSuspended$1(root, lanes);
|
|
20463
|
+
ensureRootIsScheduled(root, now());
|
|
20464
|
+
throw _fatalError;
|
|
20465
|
+
}
|
|
19858
20466
|
} // We now have a consistent tree. The next step is either to commit it,
|
|
19859
20467
|
// or, if something suspended, wait to commit it after a timeout.
|
|
19860
20468
|
|
|
19861
|
-
var finishedWork = root.current.alternate;
|
|
19862
20469
|
root.finishedWork = finishedWork;
|
|
19863
20470
|
root.finishedLanes = lanes;
|
|
19864
20471
|
finishConcurrentRender(root, exitStatus, lanes);
|
|
@@ -19875,13 +20482,31 @@ function performConcurrentWorkOnRoot(root, didTimeout) {
|
|
|
19875
20482
|
return null;
|
|
19876
20483
|
}
|
|
19877
20484
|
|
|
20485
|
+
function recoverFromConcurrentError(root, errorRetryLanes) {
|
|
20486
|
+
var prevExecutionContext = executionContext;
|
|
20487
|
+
executionContext |= RetryAfterError; // If an error occurred during hydration, discard server response and fall
|
|
20488
|
+
// back to client side render.
|
|
20489
|
+
|
|
20490
|
+
if (root.isDehydrated) {
|
|
20491
|
+
root.isDehydrated = false;
|
|
20492
|
+
|
|
20493
|
+
{
|
|
20494
|
+
errorHydratingContainer(root.containerInfo);
|
|
20495
|
+
}
|
|
20496
|
+
|
|
20497
|
+
clearContainer(root.containerInfo);
|
|
20498
|
+
}
|
|
20499
|
+
|
|
20500
|
+
var exitStatus = renderRootSync(root, errorRetryLanes);
|
|
20501
|
+
executionContext = prevExecutionContext;
|
|
20502
|
+
return exitStatus;
|
|
20503
|
+
}
|
|
20504
|
+
|
|
19878
20505
|
function finishConcurrentRender(root, exitStatus, lanes) {
|
|
19879
20506
|
switch (exitStatus) {
|
|
19880
20507
|
case RootIncomplete:
|
|
19881
20508
|
case RootFatalErrored: {
|
|
19882
|
-
|
|
19883
|
-
throw Error("Root did not complete. This is a bug in React.");
|
|
19884
|
-
}
|
|
20509
|
+
throw new Error("Root did not complete. This is a bug in React.");
|
|
19885
20510
|
}
|
|
19886
20511
|
// Flow knows about invariant, so it complains if I add a break
|
|
19887
20512
|
// statement, but eslint doesn't know about invariant, so it complains
|
|
@@ -19986,13 +20611,73 @@ function finishConcurrentRender(root, exitStatus, lanes) {
|
|
|
19986
20611
|
}
|
|
19987
20612
|
|
|
19988
20613
|
default: {
|
|
19989
|
-
|
|
19990
|
-
throw Error("Unknown root exit status.");
|
|
19991
|
-
}
|
|
20614
|
+
throw new Error("Unknown root exit status.");
|
|
19992
20615
|
}
|
|
19993
20616
|
}
|
|
19994
20617
|
}
|
|
19995
20618
|
|
|
20619
|
+
function isRenderConsistentWithExternalStores(finishedWork) {
|
|
20620
|
+
// Search the rendered tree for external store reads, and check whether the
|
|
20621
|
+
// stores were mutated in a concurrent event. Intentionally using a iterative
|
|
20622
|
+
// loop instead of recursion so we can exit early.
|
|
20623
|
+
var node = finishedWork;
|
|
20624
|
+
|
|
20625
|
+
while (true) {
|
|
20626
|
+
if (node.flags & StoreConsistency) {
|
|
20627
|
+
var updateQueue = node.updateQueue;
|
|
20628
|
+
|
|
20629
|
+
if (updateQueue !== null) {
|
|
20630
|
+
var checks = updateQueue.stores;
|
|
20631
|
+
|
|
20632
|
+
if (checks !== null) {
|
|
20633
|
+
for (var i = 0; i < checks.length; i++) {
|
|
20634
|
+
var check = checks[i];
|
|
20635
|
+
var getSnapshot = check.getSnapshot;
|
|
20636
|
+
var renderedValue = check.value;
|
|
20637
|
+
|
|
20638
|
+
try {
|
|
20639
|
+
if (!objectIs(getSnapshot(), renderedValue)) {
|
|
20640
|
+
// Found an inconsistent store.
|
|
20641
|
+
return false;
|
|
20642
|
+
}
|
|
20643
|
+
} catch (error) {
|
|
20644
|
+
// If `getSnapshot` throws, return `false`. This will schedule
|
|
20645
|
+
// a re-render, and the error will be rethrown during render.
|
|
20646
|
+
return false;
|
|
20647
|
+
}
|
|
20648
|
+
}
|
|
20649
|
+
}
|
|
20650
|
+
}
|
|
20651
|
+
}
|
|
20652
|
+
|
|
20653
|
+
var child = node.child;
|
|
20654
|
+
|
|
20655
|
+
if (node.subtreeFlags & StoreConsistency && child !== null) {
|
|
20656
|
+
child.return = node;
|
|
20657
|
+
node = child;
|
|
20658
|
+
continue;
|
|
20659
|
+
}
|
|
20660
|
+
|
|
20661
|
+
if (node === finishedWork) {
|
|
20662
|
+
return true;
|
|
20663
|
+
}
|
|
20664
|
+
|
|
20665
|
+
while (node.sibling === null) {
|
|
20666
|
+
if (node.return === null || node.return === finishedWork) {
|
|
20667
|
+
return true;
|
|
20668
|
+
}
|
|
20669
|
+
|
|
20670
|
+
node = node.return;
|
|
20671
|
+
}
|
|
20672
|
+
|
|
20673
|
+
node.sibling.return = node.return;
|
|
20674
|
+
node = node.sibling;
|
|
20675
|
+
} // Flow doesn't know this is unreachable, but eslint does
|
|
20676
|
+
// eslint-disable-next-line no-unreachable
|
|
20677
|
+
|
|
20678
|
+
return true;
|
|
20679
|
+
}
|
|
20680
|
+
|
|
19996
20681
|
function markRootSuspended$1(root, suspendedLanes) {
|
|
19997
20682
|
// When suspending, we should always exclude lanes that were pinged or (more
|
|
19998
20683
|
// rarely, since we try to avoid it) updated during the render phase.
|
|
@@ -20009,8 +20694,8 @@ function performSyncWorkOnRoot(root) {
|
|
|
20009
20694
|
syncNestedUpdateFlag();
|
|
20010
20695
|
}
|
|
20011
20696
|
|
|
20012
|
-
if (
|
|
20013
|
-
throw Error("Should not already be working.");
|
|
20697
|
+
if ((executionContext & (RenderContext | CommitContext)) !== NoContext) {
|
|
20698
|
+
throw new Error("Should not already be working.");
|
|
20014
20699
|
}
|
|
20015
20700
|
|
|
20016
20701
|
flushPassiveEffects();
|
|
@@ -20029,8 +20714,8 @@ function performSyncWorkOnRoot(root) {
|
|
|
20029
20714
|
executionContext |= RetryAfterError; // If an error occurred during hydration,
|
|
20030
20715
|
// discard server response and fall back to client side render.
|
|
20031
20716
|
|
|
20032
|
-
if (root.
|
|
20033
|
-
root.
|
|
20717
|
+
if (root.isDehydrated) {
|
|
20718
|
+
root.isDehydrated = false;
|
|
20034
20719
|
|
|
20035
20720
|
{
|
|
20036
20721
|
errorHydratingContainer(root.containerInfo);
|
|
@@ -20092,7 +20777,7 @@ function batchedUpdates$1(fn, a) {
|
|
|
20092
20777
|
// Warning, this opts-out of checking the function body.
|
|
20093
20778
|
|
|
20094
20779
|
// eslint-disable-next-line no-redeclare
|
|
20095
|
-
function
|
|
20780
|
+
function flushSync(fn) {
|
|
20096
20781
|
// In legacy mode, we flush pending passive effects at the beginning of the
|
|
20097
20782
|
// next event, not at the end of the previous one.
|
|
20098
20783
|
if (
|
|
@@ -20128,22 +20813,6 @@ function flushSyncWithoutWarningIfAlreadyRendering(fn) {
|
|
|
20128
20813
|
flushSyncCallbacks();
|
|
20129
20814
|
}
|
|
20130
20815
|
}
|
|
20131
|
-
} // Overload the definition to the two valid signatures.
|
|
20132
|
-
// Warning, this opts-out of checking the function body.
|
|
20133
|
-
|
|
20134
|
-
// eslint-disable-next-line no-redeclare
|
|
20135
|
-
function flushSync(fn) {
|
|
20136
|
-
{
|
|
20137
|
-
if ((executionContext & (RenderContext | CommitContext)) !== NoContext) {
|
|
20138
|
-
error(
|
|
20139
|
-
"flushSync was called from inside a lifecycle method. React cannot " +
|
|
20140
|
-
"flush when React is already rendering. Consider moving this call to " +
|
|
20141
|
-
"a scheduler task or micro task."
|
|
20142
|
-
);
|
|
20143
|
-
}
|
|
20144
|
-
}
|
|
20145
|
-
|
|
20146
|
-
return flushSyncWithoutWarningIfAlreadyRendering(fn);
|
|
20147
20816
|
}
|
|
20148
20817
|
function pushRenderLanes(fiber, lanes) {
|
|
20149
20818
|
push(subtreeRenderLanesCursor, subtreeRenderLanes, fiber);
|
|
@@ -20232,6 +20901,29 @@ function handleError(root, thrownValue) {
|
|
|
20232
20901
|
stopProfilerTimerIfRunningAndRecordDelta(erroredWork, true);
|
|
20233
20902
|
}
|
|
20234
20903
|
|
|
20904
|
+
if (enableSchedulingProfiler) {
|
|
20905
|
+
markComponentRenderStopped();
|
|
20906
|
+
|
|
20907
|
+
if (
|
|
20908
|
+
thrownValue !== null &&
|
|
20909
|
+
typeof thrownValue === "object" &&
|
|
20910
|
+
typeof thrownValue.then === "function"
|
|
20911
|
+
) {
|
|
20912
|
+
var wakeable = thrownValue;
|
|
20913
|
+
markComponentSuspended(
|
|
20914
|
+
erroredWork,
|
|
20915
|
+
wakeable,
|
|
20916
|
+
workInProgressRootRenderLanes
|
|
20917
|
+
);
|
|
20918
|
+
} else {
|
|
20919
|
+
markComponentErrored(
|
|
20920
|
+
erroredWork,
|
|
20921
|
+
thrownValue,
|
|
20922
|
+
workInProgressRootRenderLanes
|
|
20923
|
+
);
|
|
20924
|
+
}
|
|
20925
|
+
}
|
|
20926
|
+
|
|
20235
20927
|
throwException(
|
|
20236
20928
|
root,
|
|
20237
20929
|
erroredWork.return,
|
|
@@ -20295,7 +20987,8 @@ function renderDidSuspend() {
|
|
|
20295
20987
|
function renderDidSuspendDelayIfPossible() {
|
|
20296
20988
|
if (
|
|
20297
20989
|
workInProgressRootExitStatus === RootIncomplete ||
|
|
20298
|
-
workInProgressRootExitStatus === RootSuspended
|
|
20990
|
+
workInProgressRootExitStatus === RootSuspended ||
|
|
20991
|
+
workInProgressRootExitStatus === RootErrored
|
|
20299
20992
|
) {
|
|
20300
20993
|
workInProgressRootExitStatus = RootSuspendedWithDelay;
|
|
20301
20994
|
} // Check if there are updates that we skipped tree that might have unblocked
|
|
@@ -20317,7 +21010,7 @@ function renderDidSuspendDelayIfPossible() {
|
|
|
20317
21010
|
}
|
|
20318
21011
|
}
|
|
20319
21012
|
function renderDidError() {
|
|
20320
|
-
if (workInProgressRootExitStatus !==
|
|
21013
|
+
if (workInProgressRootExitStatus !== RootSuspendedWithDelay) {
|
|
20321
21014
|
workInProgressRootExitStatus = RootErrored;
|
|
20322
21015
|
}
|
|
20323
21016
|
} // Called during render to determine if anything has suspended.
|
|
@@ -20370,11 +21063,10 @@ function renderRootSync(root, lanes) {
|
|
|
20370
21063
|
|
|
20371
21064
|
if (workInProgress !== null) {
|
|
20372
21065
|
// This is a sync render, so we should have finished the whole tree.
|
|
20373
|
-
|
|
20374
|
-
|
|
20375
|
-
"
|
|
20376
|
-
|
|
20377
|
-
}
|
|
21066
|
+
throw new Error(
|
|
21067
|
+
"Cannot commit an incomplete root. This error is likely caused by a " +
|
|
21068
|
+
"bug in React. Please file an issue."
|
|
21069
|
+
);
|
|
20378
21070
|
}
|
|
20379
21071
|
|
|
20380
21072
|
workInProgressRoot = null;
|
|
@@ -20598,8 +21290,8 @@ function commitRootImpl(root, renderPriorityLevel) {
|
|
|
20598
21290
|
|
|
20599
21291
|
flushRenderPhaseStrictModeWarningsInDEV();
|
|
20600
21292
|
|
|
20601
|
-
if (
|
|
20602
|
-
throw Error("Should not already be working.");
|
|
21293
|
+
if ((executionContext & (RenderContext | CommitContext)) !== NoContext) {
|
|
21294
|
+
throw new Error("Should not already be working.");
|
|
20603
21295
|
}
|
|
20604
21296
|
|
|
20605
21297
|
var finishedWork = root.finishedWork;
|
|
@@ -20621,9 +21313,10 @@ function commitRootImpl(root, renderPriorityLevel) {
|
|
|
20621
21313
|
root.finishedWork = null;
|
|
20622
21314
|
root.finishedLanes = NoLanes;
|
|
20623
21315
|
|
|
20624
|
-
if (
|
|
20625
|
-
throw Error(
|
|
20626
|
-
"Cannot commit the same tree as before. This error is likely caused by
|
|
21316
|
+
if (finishedWork === root.current) {
|
|
21317
|
+
throw new Error(
|
|
21318
|
+
"Cannot commit the same tree as before. This error is likely caused by " +
|
|
21319
|
+
"a bug in React. Please file an issue."
|
|
20627
21320
|
);
|
|
20628
21321
|
} // commitRoot never returns a continuation; it always finishes synchronously.
|
|
20629
21322
|
// So we can clear these now to allow a new callback to be scheduled.
|
|
@@ -20737,6 +21430,15 @@ function commitRootImpl(root, renderPriorityLevel) {
|
|
|
20737
21430
|
} // Read this again, since an effect might have updated it
|
|
20738
21431
|
|
|
20739
21432
|
remainingLanes = root.pendingLanes; // Check if there's remaining work on this root
|
|
21433
|
+
// TODO: This is part of the `componentDidCatch` implementation. Its purpose
|
|
21434
|
+
// is to detect whether something might have called setState inside
|
|
21435
|
+
// `componentDidCatch`. The mechanism is known to be flawed because `setState`
|
|
21436
|
+
// inside `componentDidCatch` is itself flawed — that's why we recommend
|
|
21437
|
+
// `getDerivedStateFromError` instead. However, it could be improved by
|
|
21438
|
+
// checking if remainingLanes includes Sync work, instead of whether there's
|
|
21439
|
+
// any work remaining at all (which would also include stuff like Suspense
|
|
21440
|
+
// retries or transitions). It's been like this for a while, though, so fixing
|
|
21441
|
+
// it probably isn't that urgent.
|
|
20740
21442
|
|
|
20741
21443
|
if (remainingLanes === NoLanes) {
|
|
20742
21444
|
// If there's no remaining work, we can clear the set of already failed
|
|
@@ -20750,22 +21452,6 @@ function commitRootImpl(root, renderPriorityLevel) {
|
|
|
20750
21452
|
}
|
|
20751
21453
|
}
|
|
20752
21454
|
|
|
20753
|
-
if (includesSomeLane(remainingLanes, SyncLane)) {
|
|
20754
|
-
{
|
|
20755
|
-
markNestedUpdateScheduled();
|
|
20756
|
-
} // Count the number of times the root synchronously re-renders without
|
|
20757
|
-
// finishing. If there are too many, it indicates an infinite update loop.
|
|
20758
|
-
|
|
20759
|
-
if (root === rootWithNestedUpdates) {
|
|
20760
|
-
nestedUpdateCount++;
|
|
20761
|
-
} else {
|
|
20762
|
-
nestedUpdateCount = 0;
|
|
20763
|
-
rootWithNestedUpdates = root;
|
|
20764
|
-
}
|
|
20765
|
-
} else {
|
|
20766
|
-
nestedUpdateCount = 0;
|
|
20767
|
-
}
|
|
20768
|
-
|
|
20769
21455
|
onCommitRoot(finishedWork.stateNode, renderPriorityLevel);
|
|
20770
21456
|
|
|
20771
21457
|
{
|
|
@@ -20796,6 +21482,24 @@ function commitRootImpl(root, renderPriorityLevel) {
|
|
|
20796
21482
|
root.tag !== LegacyRoot
|
|
20797
21483
|
) {
|
|
20798
21484
|
flushPassiveEffects();
|
|
21485
|
+
} // Read this again, since a passive effect might have updated it
|
|
21486
|
+
|
|
21487
|
+
remainingLanes = root.pendingLanes;
|
|
21488
|
+
|
|
21489
|
+
if (includesSomeLane(remainingLanes, SyncLane)) {
|
|
21490
|
+
{
|
|
21491
|
+
markNestedUpdateScheduled();
|
|
21492
|
+
} // Count the number of times the root synchronously re-renders without
|
|
21493
|
+
// finishing. If there are too many, it indicates an infinite update loop.
|
|
21494
|
+
|
|
21495
|
+
if (root === rootWithNestedUpdates) {
|
|
21496
|
+
nestedUpdateCount++;
|
|
21497
|
+
} else {
|
|
21498
|
+
nestedUpdateCount = 0;
|
|
21499
|
+
rootWithNestedUpdates = root;
|
|
21500
|
+
}
|
|
21501
|
+
} else {
|
|
21502
|
+
nestedUpdateCount = 0;
|
|
20799
21503
|
} // If layout work was scheduled, flush it now.
|
|
20800
21504
|
|
|
20801
21505
|
flushSyncCallbacks();
|
|
@@ -20854,8 +21558,8 @@ function flushPassiveEffectsImpl() {
|
|
|
20854
21558
|
|
|
20855
21559
|
pendingPassiveEffectsLanes = NoLanes;
|
|
20856
21560
|
|
|
20857
|
-
if (
|
|
20858
|
-
throw Error("Cannot flush passive effects while already rendering.");
|
|
21561
|
+
if ((executionContext & (RenderContext | CommitContext)) !== NoContext) {
|
|
21562
|
+
throw new Error("Cannot flush passive effects while already rendering.");
|
|
20859
21563
|
}
|
|
20860
21564
|
|
|
20861
21565
|
var prevExecutionContext = executionContext;
|
|
@@ -21101,12 +21805,12 @@ function checkForNestedUpdates() {
|
|
|
21101
21805
|
if (nestedUpdateCount > NESTED_UPDATE_LIMIT) {
|
|
21102
21806
|
nestedUpdateCount = 0;
|
|
21103
21807
|
rootWithNestedUpdates = null;
|
|
21104
|
-
|
|
21105
|
-
|
|
21106
|
-
|
|
21107
|
-
"
|
|
21108
|
-
|
|
21109
|
-
|
|
21808
|
+
throw new Error(
|
|
21809
|
+
"Maximum update depth exceeded. This can happen when a component " +
|
|
21810
|
+
"repeatedly calls setState inside componentWillUpdate or " +
|
|
21811
|
+
"componentDidUpdate. React limits the number of nested updates to " +
|
|
21812
|
+
"prevent infinite loops."
|
|
21813
|
+
);
|
|
21110
21814
|
}
|
|
21111
21815
|
|
|
21112
21816
|
{
|
|
@@ -21312,7 +22016,7 @@ var beginWork$1;
|
|
|
21312
22016
|
originalError._suppressLogging = true;
|
|
21313
22017
|
}
|
|
21314
22018
|
} // We always throw the original error in case the second render pass is not idempotent.
|
|
21315
|
-
// This can happen if a memoized function or CommonJS module doesn't throw after first
|
|
22019
|
+
// This can happen if a memoized function or CommonJS module doesn't throw after first invocation.
|
|
21316
22020
|
|
|
21317
22021
|
throw originalError;
|
|
21318
22022
|
}
|
|
@@ -21491,6 +22195,7 @@ function warnIfNotCurrentlyActingUpdatesInDEV(fiber) {
|
|
|
21491
22195
|
|
|
21492
22196
|
var warnIfNotCurrentlyActingUpdatesInDev = warnIfNotCurrentlyActingUpdatesInDEV;
|
|
21493
22197
|
|
|
22198
|
+
/* eslint-disable react-internal/prod-error-codes */
|
|
21494
22199
|
var resolveFamily = null; // $FlowFixMe Flow gets confused by a WeakSet feature check below.
|
|
21495
22200
|
|
|
21496
22201
|
var failedBoundaries = null;
|
|
@@ -22384,14 +23089,11 @@ function createFiberFromTypeAndProps(
|
|
|
22384
23089
|
}
|
|
22385
23090
|
}
|
|
22386
23091
|
|
|
22387
|
-
|
|
22388
|
-
|
|
22389
|
-
"
|
|
22390
|
-
|
|
22391
|
-
|
|
22392
|
-
info
|
|
22393
|
-
);
|
|
22394
|
-
}
|
|
23092
|
+
throw new Error(
|
|
23093
|
+
"Element type is invalid: expected a string (for built-in " +
|
|
23094
|
+
"components) or a class/function (for composite components) " +
|
|
23095
|
+
("but got: " + (type == null ? type : typeof type) + "." + info)
|
|
23096
|
+
);
|
|
22395
23097
|
}
|
|
22396
23098
|
}
|
|
22397
23099
|
}
|
|
@@ -22410,9 +23112,7 @@ function createFiberFromTypeAndProps(
|
|
|
22410
23112
|
function createOffscreenHostContainerFiber(props, fiberMode, lanes, key) {
|
|
22411
23113
|
{
|
|
22412
23114
|
// Only implemented in persistent mode
|
|
22413
|
-
|
|
22414
|
-
throw Error("Not implemented.");
|
|
22415
|
-
}
|
|
23115
|
+
throw new Error("Not implemented.");
|
|
22416
23116
|
}
|
|
22417
23117
|
}
|
|
22418
23118
|
function createFiberFromElement(element, mode, lanes) {
|
|
@@ -22571,7 +23271,7 @@ function FiberRootNode(containerInfo, tag, hydrate) {
|
|
|
22571
23271
|
this.timeoutHandle = noTimeout;
|
|
22572
23272
|
this.context = null;
|
|
22573
23273
|
this.pendingContext = null;
|
|
22574
|
-
this.
|
|
23274
|
+
this.isDehydrated = hydrate;
|
|
22575
23275
|
this.callbackNode = null;
|
|
22576
23276
|
this.callbackPriority = NoLane;
|
|
22577
23277
|
this.eventTimes = createLaneMap(NoLanes);
|
|
@@ -22602,11 +23302,11 @@ function FiberRootNode(containerInfo, tag, hydrate) {
|
|
|
22602
23302
|
{
|
|
22603
23303
|
switch (tag) {
|
|
22604
23304
|
case ConcurrentRoot:
|
|
22605
|
-
this._debugRootType = "createRoot()";
|
|
23305
|
+
this._debugRootType = hydrate ? "hydrateRoot()" : "createRoot()";
|
|
22606
23306
|
break;
|
|
22607
23307
|
|
|
22608
23308
|
case LegacyRoot:
|
|
22609
|
-
this._debugRootType = "
|
|
23309
|
+
this._debugRootType = hydrate ? "hydrate()" : "render()";
|
|
22610
23310
|
break;
|
|
22611
23311
|
}
|
|
22612
23312
|
}
|
|
@@ -22649,6 +23349,11 @@ function createPortal(
|
|
|
22649
23349
|
) {
|
|
22650
23350
|
var key =
|
|
22651
23351
|
arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
|
|
23352
|
+
|
|
23353
|
+
{
|
|
23354
|
+
checkKeyStringCoercion(key);
|
|
23355
|
+
}
|
|
23356
|
+
|
|
22652
23357
|
return {
|
|
22653
23358
|
// This tag allow us to uniquely identify this as a React Portal
|
|
22654
23359
|
$$typeof: REACT_PORTAL_TYPE,
|
|
@@ -22692,16 +23397,12 @@ function findHostInstanceWithWarning(component, methodName) {
|
|
|
22692
23397
|
|
|
22693
23398
|
if (fiber === undefined) {
|
|
22694
23399
|
if (typeof component.render === "function") {
|
|
22695
|
-
|
|
22696
|
-
throw Error("Unable to find node on an unmounted component.");
|
|
22697
|
-
}
|
|
23400
|
+
throw new Error("Unable to find node on an unmounted component.");
|
|
22698
23401
|
} else {
|
|
22699
|
-
|
|
22700
|
-
|
|
22701
|
-
|
|
22702
|
-
|
|
22703
|
-
);
|
|
22704
|
-
}
|
|
23402
|
+
var keys = Object.keys(component).join(",");
|
|
23403
|
+
throw new Error(
|
|
23404
|
+
"Argument appears to not be a ReactComponent. Keys: " + keys
|
|
23405
|
+
);
|
|
22705
23406
|
}
|
|
22706
23407
|
}
|
|
22707
23408
|
|