@office-iss/react-native-win32 0.69.0 → 0.70.0-preview.1

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.
Files changed (154) hide show
  1. package/.eslintrc.js +0 -1
  2. package/.flowconfig +5 -1
  3. package/CHANGELOG.json +194 -32
  4. package/CHANGELOG.md +79 -19
  5. package/IntegrationTests/AsyncStorageTest.js +20 -4
  6. package/IntegrationTests/BUCK +2 -2
  7. package/IntegrationTests/LayoutEventsTest.js +4 -1
  8. package/IntegrationTests/{launchWebSocketServer.command → launchWebSocketServer.sh} +3 -9
  9. package/Libraries/Alert/Alert.js +18 -4
  10. package/Libraries/Alert/Alert.win32.js +2 -0
  11. package/Libraries/Alert/NativeAlertManager.js +1 -0
  12. package/Libraries/Animated/Animated.js +2 -2
  13. package/Libraries/Animated/AnimatedEvent.js +7 -4
  14. package/Libraries/Animated/AnimatedImplementation.js +17 -3
  15. package/Libraries/Animated/AnimatedMock.js +7 -2
  16. package/Libraries/Animated/NativeAnimatedHelper.js +220 -95
  17. package/Libraries/Animated/NativeAnimatedModule.js +3 -0
  18. package/Libraries/Animated/NativeAnimatedTurboModule.js +3 -0
  19. package/Libraries/Animated/animations/SpringAnimation.js +3 -3
  20. package/Libraries/Animated/animations/TimingAnimation.js +3 -3
  21. package/Libraries/Animated/createAnimatedComponent.js +8 -1
  22. package/Libraries/Animated/nodes/AnimatedAddition.js +3 -1
  23. package/Libraries/Animated/nodes/AnimatedColor.js +50 -29
  24. package/Libraries/Animated/nodes/AnimatedDiffClamp.js +3 -1
  25. package/Libraries/Animated/nodes/AnimatedDivision.js +3 -1
  26. package/Libraries/Animated/nodes/AnimatedInterpolation.js +22 -21
  27. package/Libraries/Animated/nodes/AnimatedModulo.js +3 -1
  28. package/Libraries/Animated/nodes/AnimatedMultiplication.js +3 -2
  29. package/Libraries/Animated/nodes/AnimatedProps.js +20 -12
  30. package/Libraries/Animated/nodes/AnimatedStyle.js +19 -16
  31. package/Libraries/Animated/nodes/AnimatedSubtraction.js +3 -1
  32. package/Libraries/Animated/nodes/AnimatedTransform.js +5 -5
  33. package/Libraries/Animated/nodes/AnimatedValue.js +14 -5
  34. package/Libraries/Animated/nodes/AnimatedValueXY.js +28 -1
  35. package/Libraries/Animated/useAnimatedProps.js +1 -0
  36. package/Libraries/AppState/AppState.js +0 -32
  37. package/Libraries/BatchedBridge/MessageQueue.js +21 -15
  38. package/Libraries/BatchedBridge/NativeModules.js +3 -4
  39. package/Libraries/Blob/FileReader.js +0 -6
  40. package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js +0 -20
  41. package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.win32.js +0 -20
  42. package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js +4 -0
  43. package/Libraries/Components/Keyboard/Keyboard.js +0 -11
  44. package/Libraries/Components/Pressable/Pressable.js +2 -0
  45. package/Libraries/Components/Pressable/Pressable.win32.js +2 -0
  46. package/Libraries/Components/SafeAreaView/RCTSafeAreaViewNativeComponent.js +1 -3
  47. package/Libraries/Components/SafeAreaView/SafeAreaView.js +3 -30
  48. package/Libraries/Components/SafeAreaView/SafeAreaView.win32.js +4 -32
  49. package/Libraries/Components/ScrollView/ScrollView.js +13 -11
  50. package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +5 -3
  51. package/Libraries/Components/StatusBar/StatusBar.js +10 -7
  52. package/Libraries/Components/TextInput/InputAccessoryView.js +14 -13
  53. package/Libraries/Components/TextInput/TextInput.js +12 -2
  54. package/Libraries/Components/Touchable/PooledClass.js +16 -4
  55. package/Libraries/Components/Touchable/Touchable.js +50 -1
  56. package/Libraries/Components/Touchable/Touchable.win32.js +972 -0
  57. package/Libraries/Components/Touchable/TouchableNativeFeedback.js +6 -2
  58. package/Libraries/Components/View/ReactNativeStyleAttributes.js +0 -7
  59. package/Libraries/Components/View/ViewPropTypes.js +3 -8
  60. package/Libraries/Components/View/ViewPropTypes.win32.js +3 -8
  61. package/Libraries/Core/ExceptionsManager.js +2 -0
  62. package/Libraries/Core/ReactNativeVersion.js +2 -2
  63. package/Libraries/Core/Timers/JSTimers.js +2 -2
  64. package/Libraries/Core/polyfillPromise.js +0 -32
  65. package/Libraries/Core/setUpBatchedBridge.js +5 -1
  66. package/Libraries/Core/setUpPerformance.js +1 -1
  67. package/Libraries/EventEmitter/NativeEventEmitter.js +0 -13
  68. package/Libraries/Image/AssetSourceResolver.js +2 -2
  69. package/Libraries/Image/Image.android.js +5 -3
  70. package/Libraries/Image/Image.ios.js +6 -3
  71. package/Libraries/Image/Image.win32.js +6 -3
  72. package/Libraries/Image/ImageSource.js +7 -5
  73. package/Libraries/Inspector/ElementBox.js +2 -2
  74. package/Libraries/Inspector/NetworkOverlay.js +13 -8
  75. package/Libraries/Interaction/PanResponder.js +16 -14
  76. package/Libraries/Linking/Linking.js +0 -11
  77. package/Libraries/Lists/FlatList.js +3 -2
  78. package/Libraries/Lists/SectionList.js +2 -0
  79. package/Libraries/Lists/ViewabilityHelper.js +7 -3
  80. package/Libraries/Lists/VirtualizeUtils.js +33 -20
  81. package/Libraries/Lists/VirtualizedList.js +93 -47
  82. package/Libraries/Lists/VirtualizedListContext.js +1 -0
  83. package/Libraries/Lists/VirtualizedSectionList.js +14 -9
  84. package/Libraries/Lists/__tests__/VirtualizeUtils-test.js +19 -18
  85. package/Libraries/Lists/__tests__/VirtualizedList-test.js +10 -6
  86. package/Libraries/LogBox/Data/LogBoxData.js +1 -1
  87. package/Libraries/LogBox/Data/parseLogBoxLog.js +1 -1
  88. package/Libraries/LogBox/LogBox.js +3 -1
  89. package/Libraries/LogBox/UI/AnsiHighlight.js +2 -0
  90. package/Libraries/LogBox/UI/LogBoxInspectorCodeFrame.js +3 -0
  91. package/Libraries/LogBox/UI/LogBoxInspectorSourceMapStatus.js +0 -3
  92. package/Libraries/LogBox/UI/LogBoxInspectorStackFrames.js +8 -3
  93. package/Libraries/NativeComponent/BaseViewConfig.android.js +9 -18
  94. package/Libraries/NativeComponent/BaseViewConfig.ios.js +26 -12
  95. package/Libraries/NativeComponent/BaseViewConfig.win32.js +26 -12
  96. package/Libraries/Network/XMLHttpRequest.js +9 -11
  97. package/Libraries/Performance/PureComponentDebug.js +1 -0
  98. package/Libraries/PermissionsAndroid/NativePermissionsAndroid.js +9 -1
  99. package/Libraries/PermissionsAndroid/PermissionsAndroid.js +16 -0
  100. package/Libraries/Pressability/Pressability.js +26 -16
  101. package/Libraries/Pressability/Pressability.win32.js +26 -16
  102. package/Libraries/Promise.js +0 -1
  103. package/Libraries/ReactNative/AppRegistry.js +16 -13
  104. package/Libraries/ReactNative/BridgelessUIManager.js +2 -0
  105. package/Libraries/ReactNative/PaperUIManager.js +9 -9
  106. package/Libraries/ReactNative/PaperUIManager.win32.js +7 -8
  107. package/Libraries/ReactNative/ReactNativeFeatureFlags.js +12 -0
  108. package/Libraries/ReactNative/ReactNativeRuntimeDiagnostics.js +68 -0
  109. package/Libraries/ReactNative/getNativeComponentAttributes.js +6 -7
  110. package/Libraries/ReactNative/renderApplication.js +1 -1
  111. package/Libraries/Renderer/implementations/ReactFabric-dev.js +4443 -3615
  112. package/Libraries/Renderer/implementations/ReactFabric-prod.js +1496 -1170
  113. package/Libraries/Renderer/implementations/ReactFabric-profiling.js +1694 -1356
  114. package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js +4439 -3588
  115. package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js +1583 -1249
  116. package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.js +1719 -1372
  117. package/Libraries/Storage/AsyncStorage.js +7 -1
  118. package/Libraries/StyleSheet/PlatformColorValueTypes.ios.js +8 -0
  119. package/Libraries/StyleSheet/flattenStyle.js +1 -1
  120. package/Libraries/StyleSheet/processTransform.js +2 -0
  121. package/Libraries/StyleSheet/splitLayoutProps.js +2 -0
  122. package/Libraries/Text/Text.js +15 -7
  123. package/Libraries/Types/CoreEventTypes.js +137 -11
  124. package/Libraries/Types/CoreEventTypes.win32.js +147 -22
  125. package/Libraries/Utilities/Dimensions.js +0 -13
  126. package/Libraries/Utilities/Dimensions.win32.js +0 -9
  127. package/Libraries/Utilities/HMRClient.js +3 -3
  128. package/Libraries/Utilities/Platform.ios.js +0 -7
  129. package/Libraries/Utilities/ReactNativeTestTools.js +3 -1
  130. package/Libraries/Utilities/codegenNativeCommands.js +11 -2
  131. package/Libraries/Utilities/deepFreezeAndThrowOnMutationInDev.js +2 -0
  132. package/Libraries/Utilities/stringifySafe.js +3 -1
  133. package/Libraries/Utilities/truncate.js +1 -1
  134. package/Libraries/Utilities/verifyComponentAttributeEquivalence.js +2 -2
  135. package/Libraries/Vibration/Vibration.js +1 -1
  136. package/Libraries/WebSocket/WebSocket.js +1 -0
  137. package/Libraries/vendor/emitter/EventEmitter.js +105 -12
  138. package/Libraries/vendor/emitter/__flowtests__/EventEmitter-flowtest.js +73 -117
  139. package/flow/JSITimerInternalType.js +30 -0
  140. package/jest/assetFileTransformer.js +3 -2
  141. package/jest/setup.js +4 -0
  142. package/jest.config.js +0 -1
  143. package/overrides.json +23 -16
  144. package/package.json +23 -24
  145. package/rntypes/index.d.ts +0 -1
  146. package/src/rntypes/index.d.ts +0 -1
  147. package/Libraries/vendor/emitter/EventSubscription.js +0 -19
  148. package/Libraries/vendor/emitter/_EmitterSubscription.js +0 -62
  149. package/Libraries/vendor/emitter/_EventEmitter.js +0 -184
  150. package/Libraries/vendor/emitter/_EventSubscription.js +0 -45
  151. package/Libraries/vendor/emitter/_EventSubscriptionVendor.js +0 -108
  152. package/jest/preprocessor.js +0 -40
  153. package/jest/preprocessor_DO_NOT_USE.js +0 -122
  154. package/src/Libraries/Lists/__tests__/__snapshots__/VirtualizeUtils-test.js.snap +0 -3
@@ -8,7 +8,7 @@
8
8
  * @nolint
9
9
  * @providesModule ReactFabric-prod
10
10
  * @preventMunge
11
- * @generated SignedSource<<3337b7b8b4a72069e657cf2646bcff44>>
11
+ * @generated SignedSource<<da4adb6862dba6980fe677cde685b767>>
12
12
  */
13
13
 
14
14
  "use strict";
@@ -1017,7 +1017,7 @@ eventPluginOrder = Array.prototype.slice.call([
1017
1017
  "ReactNativeBridgeEventPlugin"
1018
1018
  ]);
1019
1019
  recomputePluginOrdering();
1020
- var injectedNamesToPlugins$jscomp$inline_215 = {
1020
+ var injectedNamesToPlugins$jscomp$inline_218 = {
1021
1021
  ResponderEventPlugin: ResponderEventPlugin,
1022
1022
  ReactNativeBridgeEventPlugin: {
1023
1023
  eventTypes: {},
@@ -1063,33 +1063,33 @@ var injectedNamesToPlugins$jscomp$inline_215 = {
1063
1063
  }
1064
1064
  }
1065
1065
  },
1066
- isOrderingDirty$jscomp$inline_216 = !1,
1067
- pluginName$jscomp$inline_217;
1068
- for (pluginName$jscomp$inline_217 in injectedNamesToPlugins$jscomp$inline_215)
1066
+ isOrderingDirty$jscomp$inline_219 = !1,
1067
+ pluginName$jscomp$inline_220;
1068
+ for (pluginName$jscomp$inline_220 in injectedNamesToPlugins$jscomp$inline_218)
1069
1069
  if (
1070
- injectedNamesToPlugins$jscomp$inline_215.hasOwnProperty(
1071
- pluginName$jscomp$inline_217
1070
+ injectedNamesToPlugins$jscomp$inline_218.hasOwnProperty(
1071
+ pluginName$jscomp$inline_220
1072
1072
  )
1073
1073
  ) {
1074
- var pluginModule$jscomp$inline_218 =
1075
- injectedNamesToPlugins$jscomp$inline_215[pluginName$jscomp$inline_217];
1074
+ var pluginModule$jscomp$inline_221 =
1075
+ injectedNamesToPlugins$jscomp$inline_218[pluginName$jscomp$inline_220];
1076
1076
  if (
1077
- !namesToPlugins.hasOwnProperty(pluginName$jscomp$inline_217) ||
1078
- namesToPlugins[pluginName$jscomp$inline_217] !==
1079
- pluginModule$jscomp$inline_218
1077
+ !namesToPlugins.hasOwnProperty(pluginName$jscomp$inline_220) ||
1078
+ namesToPlugins[pluginName$jscomp$inline_220] !==
1079
+ pluginModule$jscomp$inline_221
1080
1080
  ) {
1081
- if (namesToPlugins[pluginName$jscomp$inline_217])
1081
+ if (namesToPlugins[pluginName$jscomp$inline_220])
1082
1082
  throw Error(
1083
1083
  "EventPluginRegistry: Cannot inject two different event plugins using the same name, `" +
1084
- (pluginName$jscomp$inline_217 + "`.")
1084
+ (pluginName$jscomp$inline_220 + "`.")
1085
1085
  );
1086
1086
  namesToPlugins[
1087
- pluginName$jscomp$inline_217
1088
- ] = pluginModule$jscomp$inline_218;
1089
- isOrderingDirty$jscomp$inline_216 = !0;
1087
+ pluginName$jscomp$inline_220
1088
+ ] = pluginModule$jscomp$inline_221;
1089
+ isOrderingDirty$jscomp$inline_219 = !0;
1090
1090
  }
1091
1091
  }
1092
- isOrderingDirty$jscomp$inline_216 && recomputePluginOrdering();
1092
+ isOrderingDirty$jscomp$inline_219 && recomputePluginOrdering();
1093
1093
  function getInstanceFromInstance(instanceHandle) {
1094
1094
  return instanceHandle;
1095
1095
  }
@@ -1841,6 +1841,12 @@ function getLanesToRetrySynchronouslyOnError(root) {
1841
1841
  root = root.pendingLanes & -1073741825;
1842
1842
  return 0 !== root ? root : root & 1073741824 ? 1073741824 : 0;
1843
1843
  }
1844
+ function claimNextTransitionLane() {
1845
+ var lane = nextTransitionLane;
1846
+ nextTransitionLane <<= 1;
1847
+ 0 === (nextTransitionLane & 4194240) && (nextTransitionLane = 64);
1848
+ return lane;
1849
+ }
1844
1850
  function createLaneMap(initial) {
1845
1851
  for (var laneMap = [], i = 0; 31 > i; i++) laneMap.push(initial);
1846
1852
  return laneMap;
@@ -2189,7 +2195,28 @@ function flushSyncCallbacks() {
2189
2195
  }
2190
2196
  return null;
2191
2197
  }
2192
- var ReactCurrentBatchConfig = ReactSharedInternals.ReactCurrentBatchConfig;
2198
+ var forkStack = [],
2199
+ forkStackIndex = 0,
2200
+ treeForkProvider = null,
2201
+ idStack = [],
2202
+ idStackIndex = 0,
2203
+ treeContextProvider = null;
2204
+ function popTreeContext(workInProgress) {
2205
+ for (; workInProgress === treeForkProvider; )
2206
+ (treeForkProvider = forkStack[--forkStackIndex]),
2207
+ (forkStack[forkStackIndex] = null),
2208
+ --forkStackIndex,
2209
+ (forkStack[forkStackIndex] = null);
2210
+ for (; workInProgress === treeContextProvider; )
2211
+ (treeContextProvider = idStack[--idStackIndex]),
2212
+ (idStack[idStackIndex] = null),
2213
+ --idStackIndex,
2214
+ (idStack[idStackIndex] = null),
2215
+ --idStackIndex,
2216
+ (idStack[idStackIndex] = null);
2217
+ }
2218
+ var hydrationErrors = null,
2219
+ ReactCurrentBatchConfig = ReactSharedInternals.ReactCurrentBatchConfig;
2193
2220
  function shallowEqual(objA, objB) {
2194
2221
  if (objectIs(objA, objB)) return !0;
2195
2222
  if (
@@ -2334,9 +2361,7 @@ function enqueueUpdate(fiber, update) {
2334
2361
  var updateQueue = fiber.updateQueue;
2335
2362
  null !== updateQueue &&
2336
2363
  ((updateQueue = updateQueue.shared),
2337
- null !== workInProgressRoot &&
2338
- 0 !== (fiber.mode & 1) &&
2339
- 0 === (executionContext & 2)
2364
+ isInterleavedUpdate(fiber)
2340
2365
  ? ((fiber = updateQueue.interleaved),
2341
2366
  null === fiber
2342
2367
  ? ((update.next = update),
@@ -2704,26 +2729,6 @@ function mountClassInstance(workInProgress, ctor, newProps, renderLanes) {
2704
2729
  "function" === typeof instance.componentDidMount &&
2705
2730
  (workInProgress.flags |= 4);
2706
2731
  }
2707
- var forkStack = [],
2708
- forkStackIndex = 0,
2709
- treeForkProvider = null,
2710
- idStack = [],
2711
- idStackIndex = 0,
2712
- treeContextProvider = null;
2713
- function popTreeContext(workInProgress) {
2714
- for (; workInProgress === treeForkProvider; )
2715
- (treeForkProvider = forkStack[--forkStackIndex]),
2716
- (forkStack[forkStackIndex] = null),
2717
- --forkStackIndex,
2718
- (forkStack[forkStackIndex] = null);
2719
- for (; workInProgress === treeContextProvider; )
2720
- (treeContextProvider = idStack[--idStackIndex]),
2721
- (idStack[idStackIndex] = null),
2722
- --idStackIndex,
2723
- (idStack[idStackIndex] = null),
2724
- --idStackIndex,
2725
- (idStack[idStackIndex] = null);
2726
- }
2727
2732
  function coerceRef(returnFiber, current, element) {
2728
2733
  returnFiber = element.ref;
2729
2734
  if (
@@ -2786,6 +2791,10 @@ function throwOnInvalidObjectType(returnFiber, newChild) {
2786
2791
  "). If you meant to render a collection of children, use an array instead."
2787
2792
  );
2788
2793
  }
2794
+ function resolveLazy(lazyType) {
2795
+ var init = lazyType._init;
2796
+ return init(lazyType._payload);
2797
+ }
2789
2798
  function ChildReconciler(shouldTrackSideEffects) {
2790
2799
  function deleteChild(returnFiber, childToDelete) {
2791
2800
  if (shouldTrackSideEffects) {
@@ -2858,7 +2867,14 @@ function ChildReconciler(shouldTrackSideEffects) {
2858
2867
  lanes,
2859
2868
  element.key
2860
2869
  );
2861
- if (null !== current && current.elementType === elementType)
2870
+ if (
2871
+ null !== current &&
2872
+ (current.elementType === elementType ||
2873
+ ("object" === typeof elementType &&
2874
+ null !== elementType &&
2875
+ elementType.$$typeof === REACT_LAZY_TYPE &&
2876
+ resolveLazy(elementType) === current.type))
2877
+ )
2862
2878
  return (
2863
2879
  (lanes = useFiber(current, element.props)),
2864
2880
  (lanes.ref = coerceRef(returnFiber, current, element)),
@@ -2949,6 +2965,9 @@ function ChildReconciler(shouldTrackSideEffects) {
2949
2965
  (newChild.return = returnFiber),
2950
2966
  newChild
2951
2967
  );
2968
+ case REACT_LAZY_TYPE:
2969
+ var init = newChild._init;
2970
+ return createChild(returnFiber, init(newChild._payload), lanes);
2952
2971
  }
2953
2972
  if (isArrayImpl(newChild) || getIteratorFn(newChild))
2954
2973
  return (
@@ -2984,6 +3003,11 @@ function ChildReconciler(shouldTrackSideEffects) {
2984
3003
  return newChild.key === key
2985
3004
  ? updatePortal(returnFiber, oldFiber, newChild, lanes)
2986
3005
  : null;
3006
+ case REACT_LAZY_TYPE:
3007
+ return (
3008
+ (key = newChild._init),
3009
+ updateSlot(returnFiber, oldFiber, key(newChild._payload), lanes)
3010
+ );
2987
3011
  }
2988
3012
  if (isArrayImpl(newChild) || getIteratorFn(newChild))
2989
3013
  return null !== key
@@ -3026,6 +3050,15 @@ function ChildReconciler(shouldTrackSideEffects) {
3026
3050
  ) || null),
3027
3051
  updatePortal(returnFiber, existingChildren, newChild, lanes)
3028
3052
  );
3053
+ case REACT_LAZY_TYPE:
3054
+ var init = newChild._init;
3055
+ return updateFromMap(
3056
+ existingChildren,
3057
+ returnFiber,
3058
+ newIdx,
3059
+ init(newChild._payload),
3060
+ lanes
3061
+ );
3029
3062
  }
3030
3063
  if (isArrayImpl(newChild) || getIteratorFn(newChild))
3031
3064
  return (
@@ -3203,7 +3236,12 @@ function ChildReconciler(shouldTrackSideEffects) {
3203
3236
  });
3204
3237
  return iteratorFn;
3205
3238
  }
3206
- return function(returnFiber, currentFirstChild, newChild, lanes) {
3239
+ function reconcileChildFibers(
3240
+ returnFiber,
3241
+ currentFirstChild,
3242
+ newChild,
3243
+ lanes
3244
+ ) {
3207
3245
  "object" === typeof newChild &&
3208
3246
  null !== newChild &&
3209
3247
  newChild.type === REACT_FRAGMENT_TYPE &&
@@ -3231,7 +3269,13 @@ function ChildReconciler(shouldTrackSideEffects) {
3231
3269
  returnFiber = currentFirstChild;
3232
3270
  break a;
3233
3271
  }
3234
- } else if (child.elementType === key) {
3272
+ } else if (
3273
+ child.elementType === key ||
3274
+ ("object" === typeof key &&
3275
+ null !== key &&
3276
+ key.$$typeof === REACT_LAZY_TYPE &&
3277
+ resolveLazy(key) === child.type)
3278
+ ) {
3235
3279
  deleteRemainingChildren(returnFiber, child.sibling);
3236
3280
  currentFirstChild = useFiber(child, newChild.props);
3237
3281
  currentFirstChild.ref = coerceRef(
@@ -3312,6 +3356,16 @@ function ChildReconciler(shouldTrackSideEffects) {
3312
3356
  returnFiber = currentFirstChild;
3313
3357
  }
3314
3358
  return placeSingleChild(returnFiber);
3359
+ case REACT_LAZY_TYPE:
3360
+ return (
3361
+ (child = newChild._init),
3362
+ reconcileChildFibers(
3363
+ returnFiber,
3364
+ currentFirstChild,
3365
+ child(newChild._payload),
3366
+ lanes
3367
+ )
3368
+ );
3315
3369
  }
3316
3370
  if (isArrayImpl(newChild))
3317
3371
  return reconcileChildrenArray(
@@ -3347,7 +3401,8 @@ function ChildReconciler(shouldTrackSideEffects) {
3347
3401
  (returnFiber = currentFirstChild)),
3348
3402
  placeSingleChild(returnFiber))
3349
3403
  : deleteRemainingChildren(returnFiber, currentFirstChild);
3350
- };
3404
+ }
3405
+ return reconcileChildFibers;
3351
3406
  }
3352
3407
  var reconcileChildFibers = ChildReconciler(!0),
3353
3408
  mountChildFibers = ChildReconciler(!1),
@@ -3834,6 +3889,19 @@ function updateMemo(nextCreate, deps) {
3834
3889
  hook.memoizedState = [nextCreate, deps];
3835
3890
  return nextCreate;
3836
3891
  }
3892
+ function updateDeferredValueImpl(hook, prevValue, value) {
3893
+ if (0 === (renderLanes & 21))
3894
+ return (
3895
+ hook.baseState && ((hook.baseState = !1), (didReceiveUpdate = !0)),
3896
+ (hook.memoizedState = value)
3897
+ );
3898
+ objectIs(value, prevValue) ||
3899
+ ((value = claimNextTransitionLane()),
3900
+ (currentlyRenderingFiber$1.lanes |= value),
3901
+ (workInProgressRootSkippedLanes |= value),
3902
+ (hook.baseState = !0));
3903
+ return prevValue;
3904
+ }
3837
3905
  function startTransition(setPending, callback) {
3838
3906
  var previousPriority = currentUpdatePriority;
3839
3907
  currentUpdatePriority =
@@ -3915,9 +3983,7 @@ function enqueueRenderPhaseUpdate(queue, update) {
3915
3983
  queue.pending = update;
3916
3984
  }
3917
3985
  function enqueueUpdate$1(fiber, queue, update) {
3918
- null !== workInProgressRoot &&
3919
- 0 !== (fiber.mode & 1) &&
3920
- 0 === (executionContext & 2)
3986
+ isInterleavedUpdate(fiber)
3921
3987
  ? ((fiber = queue.interleaved),
3922
3988
  null === fiber
3923
3989
  ? ((update.next = update),
@@ -4022,29 +4088,14 @@ var ContextOnlyDispatcher = {
4022
4088
  useState: mountState,
4023
4089
  useDebugValue: mountDebugValue,
4024
4090
  useDeferredValue: function(value) {
4025
- var _mountState = mountState(value),
4026
- prevValue = _mountState[0],
4027
- setValue = _mountState[1];
4028
- mountEffect(
4029
- function() {
4030
- var prevTransition = ReactCurrentBatchConfig$1.transition;
4031
- ReactCurrentBatchConfig$1.transition = {};
4032
- try {
4033
- setValue(value);
4034
- } finally {
4035
- ReactCurrentBatchConfig$1.transition = prevTransition;
4036
- }
4037
- },
4038
- [value]
4039
- );
4040
- return prevValue;
4091
+ return (mountWorkInProgressHook().memoizedState = value);
4041
4092
  },
4042
4093
  useTransition: function() {
4043
- var _mountState2 = mountState(!1),
4044
- isPending = _mountState2[0];
4045
- _mountState2 = startTransition.bind(null, _mountState2[1]);
4046
- mountWorkInProgressHook().memoizedState = _mountState2;
4047
- return [isPending, _mountState2];
4094
+ var _mountState = mountState(!1),
4095
+ isPending = _mountState[0];
4096
+ _mountState = startTransition.bind(null, _mountState[1]);
4097
+ mountWorkInProgressHook().memoizedState = _mountState;
4098
+ return [isPending, _mountState];
4048
4099
  },
4049
4100
  useMutableSource: function() {},
4050
4101
  useSyncExternalStore: function(subscribe, getSnapshot) {
@@ -4098,22 +4149,8 @@ var ContextOnlyDispatcher = {
4098
4149
  },
4099
4150
  useDebugValue: mountDebugValue,
4100
4151
  useDeferredValue: function(value) {
4101
- var _updateState = updateReducer(basicStateReducer),
4102
- prevValue = _updateState[0],
4103
- setValue = _updateState[1];
4104
- updateEffect(
4105
- function() {
4106
- var prevTransition = ReactCurrentBatchConfig$1.transition;
4107
- ReactCurrentBatchConfig$1.transition = {};
4108
- try {
4109
- setValue(value);
4110
- } finally {
4111
- ReactCurrentBatchConfig$1.transition = prevTransition;
4112
- }
4113
- },
4114
- [value]
4115
- );
4116
- return prevValue;
4152
+ var hook = updateWorkInProgressHook();
4153
+ return updateDeferredValueImpl(hook, currentHook.memoizedState, value);
4117
4154
  },
4118
4155
  useTransition: function() {
4119
4156
  var isPending = updateReducer(basicStateReducer)[0],
@@ -4141,22 +4178,10 @@ var ContextOnlyDispatcher = {
4141
4178
  },
4142
4179
  useDebugValue: mountDebugValue,
4143
4180
  useDeferredValue: function(value) {
4144
- var _rerenderState = rerenderReducer(basicStateReducer),
4145
- prevValue = _rerenderState[0],
4146
- setValue = _rerenderState[1];
4147
- updateEffect(
4148
- function() {
4149
- var prevTransition = ReactCurrentBatchConfig$1.transition;
4150
- ReactCurrentBatchConfig$1.transition = {};
4151
- try {
4152
- setValue(value);
4153
- } finally {
4154
- ReactCurrentBatchConfig$1.transition = prevTransition;
4155
- }
4156
- },
4157
- [value]
4158
- );
4159
- return prevValue;
4181
+ var hook = updateWorkInProgressHook();
4182
+ return null === currentHook
4183
+ ? (hook.memoizedState = value)
4184
+ : updateDeferredValueImpl(hook, currentHook.memoizedState, value);
4160
4185
  },
4161
4186
  useTransition: function() {
4162
4187
  var isPending = rerenderReducer(basicStateReducer)[0],
@@ -4259,592 +4284,94 @@ function attachPingListener(root, wakeable, lanes) {
4259
4284
  (root = pingSuspendedRoot.bind(null, root, wakeable, lanes)),
4260
4285
  wakeable.then(root, root));
4261
4286
  }
4262
- function hadNoMutationsEffects(current, completedWork) {
4263
- if (null !== current && current.child === completedWork.child) return !0;
4264
- if (0 !== (completedWork.flags & 16)) return !1;
4265
- for (current = completedWork.child; null !== current; ) {
4266
- if (0 !== (current.flags & 12854) || 0 !== (current.subtreeFlags & 12854))
4267
- return !1;
4268
- current = current.sibling;
4269
- }
4270
- return !0;
4287
+ var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner,
4288
+ didReceiveUpdate = !1;
4289
+ function reconcileChildren(current, workInProgress, nextChildren, renderLanes) {
4290
+ workInProgress.child =
4291
+ null === current
4292
+ ? mountChildFibers(workInProgress, null, nextChildren, renderLanes)
4293
+ : reconcileChildFibers(
4294
+ workInProgress,
4295
+ current.child,
4296
+ nextChildren,
4297
+ renderLanes
4298
+ );
4271
4299
  }
4272
- var appendAllChildren, updateHostContainer, updateHostComponent, updateHostText;
4273
- appendAllChildren = function(
4274
- parent,
4300
+ function updateForwardRef(
4301
+ current,
4275
4302
  workInProgress,
4276
- needsVisibilityToggle,
4277
- isHidden
4303
+ Component,
4304
+ nextProps,
4305
+ renderLanes
4278
4306
  ) {
4279
- for (var node = workInProgress.child; null !== node; ) {
4280
- if (5 === node.tag) {
4281
- var instance = node.stateNode;
4282
- needsVisibilityToggle &&
4283
- isHidden &&
4284
- (instance = cloneHiddenInstance(instance));
4285
- appendChildNode(parent.node, instance.node);
4286
- } else if (6 === node.tag) {
4287
- instance = node.stateNode;
4288
- if (needsVisibilityToggle && isHidden)
4289
- throw Error("Not yet implemented.");
4290
- appendChildNode(parent.node, instance.node);
4291
- } else if (4 !== node.tag)
4292
- if (22 === node.tag && null !== node.memoizedState)
4293
- (instance = node.child),
4294
- null !== instance && (instance.return = node),
4295
- appendAllChildren(parent, node, !0, !0);
4296
- else if (null !== node.child) {
4297
- node.child.return = node;
4298
- node = node.child;
4299
- continue;
4300
- }
4301
- if (node === workInProgress) break;
4302
- for (; null === node.sibling; ) {
4303
- if (null === node.return || node.return === workInProgress) return;
4304
- node = node.return;
4305
- }
4306
- node.sibling.return = node.return;
4307
- node = node.sibling;
4308
- }
4309
- };
4310
- function appendAllChildrenToContainer(
4311
- containerChildSet,
4307
+ Component = Component.render;
4308
+ var ref = workInProgress.ref;
4309
+ prepareToReadContext(workInProgress, renderLanes);
4310
+ nextProps = renderWithHooks(
4311
+ current,
4312
+ workInProgress,
4313
+ Component,
4314
+ nextProps,
4315
+ ref,
4316
+ renderLanes
4317
+ );
4318
+ if (null !== current && !didReceiveUpdate)
4319
+ return (
4320
+ (workInProgress.updateQueue = current.updateQueue),
4321
+ (workInProgress.flags &= -2053),
4322
+ (current.lanes &= ~renderLanes),
4323
+ bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes)
4324
+ );
4325
+ workInProgress.flags |= 1;
4326
+ reconcileChildren(current, workInProgress, nextProps, renderLanes);
4327
+ return workInProgress.child;
4328
+ }
4329
+ function updateMemoComponent(
4330
+ current,
4312
4331
  workInProgress,
4313
- needsVisibilityToggle,
4314
- isHidden
4332
+ Component,
4333
+ nextProps,
4334
+ renderLanes
4315
4335
  ) {
4316
- for (var node = workInProgress.child; null !== node; ) {
4317
- if (5 === node.tag) {
4318
- var instance = node.stateNode;
4319
- needsVisibilityToggle &&
4320
- isHidden &&
4321
- (instance = cloneHiddenInstance(instance));
4322
- appendChildNodeToSet(containerChildSet, instance.node);
4323
- } else if (6 === node.tag) {
4324
- instance = node.stateNode;
4325
- if (needsVisibilityToggle && isHidden)
4326
- throw Error("Not yet implemented.");
4327
- appendChildNodeToSet(containerChildSet, instance.node);
4328
- } else if (4 !== node.tag)
4329
- if (22 === node.tag && null !== node.memoizedState)
4330
- (instance = node.child),
4331
- null !== instance && (instance.return = node),
4332
- appendAllChildrenToContainer(containerChildSet, node, !0, !0);
4333
- else if (null !== node.child) {
4334
- node.child.return = node;
4335
- node = node.child;
4336
- continue;
4337
- }
4338
- if (node === workInProgress) break;
4339
- for (; null === node.sibling; ) {
4340
- if (null === node.return || node.return === workInProgress) return;
4341
- node = node.return;
4342
- }
4343
- node.sibling.return = node.return;
4344
- node = node.sibling;
4336
+ if (null === current) {
4337
+ var type = Component.type;
4338
+ if (
4339
+ "function" === typeof type &&
4340
+ !shouldConstruct(type) &&
4341
+ void 0 === type.defaultProps &&
4342
+ null === Component.compare &&
4343
+ void 0 === Component.defaultProps
4344
+ )
4345
+ return (
4346
+ (workInProgress.tag = 15),
4347
+ (workInProgress.type = type),
4348
+ updateSimpleMemoComponent(
4349
+ current,
4350
+ workInProgress,
4351
+ type,
4352
+ nextProps,
4353
+ renderLanes
4354
+ )
4355
+ );
4356
+ current = createFiberFromTypeAndProps(
4357
+ Component.type,
4358
+ null,
4359
+ nextProps,
4360
+ workInProgress,
4361
+ workInProgress.mode,
4362
+ renderLanes
4363
+ );
4364
+ current.ref = workInProgress.ref;
4365
+ current.return = workInProgress;
4366
+ return (workInProgress.child = current);
4345
4367
  }
4346
- }
4347
- updateHostContainer = function(current, workInProgress) {
4348
- var portalOrRoot = workInProgress.stateNode;
4349
- if (!hadNoMutationsEffects(current, workInProgress)) {
4350
- current = portalOrRoot.containerInfo;
4351
- var newChildSet = createChildNodeSet(current);
4352
- appendAllChildrenToContainer(newChildSet, workInProgress, !1, !1);
4353
- portalOrRoot.pendingChildren = newChildSet;
4354
- workInProgress.flags |= 4;
4355
- completeRoot(current, newChildSet);
4356
- }
4357
- };
4358
- updateHostComponent = function(current, workInProgress, type, newProps) {
4359
- type = current.stateNode;
4360
- var oldProps = current.memoizedProps;
4361
- if (
4362
- (current = hadNoMutationsEffects(current, workInProgress)) &&
4363
- oldProps === newProps
4364
- )
4365
- workInProgress.stateNode = type;
4366
- else {
4367
- var recyclableInstance = workInProgress.stateNode;
4368
- requiredContext(contextStackCursor$1.current);
4369
- var updatePayload = null;
4370
- oldProps !== newProps &&
4371
- ((oldProps = diffProperties(
4372
- null,
4373
- oldProps,
4374
- newProps,
4375
- recyclableInstance.canonical.viewConfig.validAttributes
4376
- )),
4377
- (recyclableInstance.canonical.currentProps = newProps),
4378
- (updatePayload = oldProps));
4379
- current && null === updatePayload
4380
- ? (workInProgress.stateNode = type)
4381
- : ((newProps = updatePayload),
4382
- (oldProps = type.node),
4383
- (type = {
4384
- node: current
4385
- ? null !== newProps
4386
- ? cloneNodeWithNewProps(oldProps, newProps)
4387
- : cloneNode(oldProps)
4388
- : null !== newProps
4389
- ? cloneNodeWithNewChildrenAndProps(oldProps, newProps)
4390
- : cloneNodeWithNewChildren(oldProps),
4391
- canonical: type.canonical
4392
- }),
4393
- (workInProgress.stateNode = type),
4394
- current
4395
- ? (workInProgress.flags |= 4)
4396
- : appendAllChildren(type, workInProgress, !1, !1));
4397
- }
4398
- };
4399
- updateHostText = function(current, workInProgress, oldText, newText) {
4400
- oldText !== newText
4401
- ? ((current = requiredContext(rootInstanceStackCursor.current)),
4402
- (oldText = requiredContext(contextStackCursor$1.current)),
4403
- (workInProgress.stateNode = createTextInstance(
4404
- newText,
4405
- current,
4406
- oldText,
4407
- workInProgress
4408
- )),
4409
- (workInProgress.flags |= 4))
4410
- : (workInProgress.stateNode = current.stateNode);
4411
- };
4412
- function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) {
4413
- switch (renderState.tailMode) {
4414
- case "hidden":
4415
- hasRenderedATailFallback = renderState.tail;
4416
- for (var lastTailNode = null; null !== hasRenderedATailFallback; )
4417
- null !== hasRenderedATailFallback.alternate &&
4418
- (lastTailNode = hasRenderedATailFallback),
4419
- (hasRenderedATailFallback = hasRenderedATailFallback.sibling);
4420
- null === lastTailNode
4421
- ? (renderState.tail = null)
4422
- : (lastTailNode.sibling = null);
4423
- break;
4424
- case "collapsed":
4425
- lastTailNode = renderState.tail;
4426
- for (var lastTailNode$35 = null; null !== lastTailNode; )
4427
- null !== lastTailNode.alternate && (lastTailNode$35 = lastTailNode),
4428
- (lastTailNode = lastTailNode.sibling);
4429
- null === lastTailNode$35
4430
- ? hasRenderedATailFallback || null === renderState.tail
4431
- ? (renderState.tail = null)
4432
- : (renderState.tail.sibling = null)
4433
- : (lastTailNode$35.sibling = null);
4434
- }
4435
- }
4436
- function bubbleProperties(completedWork) {
4437
- var didBailout =
4438
- null !== completedWork.alternate &&
4439
- completedWork.alternate.child === completedWork.child,
4440
- newChildLanes = 0,
4441
- subtreeFlags = 0;
4442
- if (didBailout)
4443
- for (var child$36 = completedWork.child; null !== child$36; )
4444
- (newChildLanes |= child$36.lanes | child$36.childLanes),
4445
- (subtreeFlags |= child$36.subtreeFlags & 14680064),
4446
- (subtreeFlags |= child$36.flags & 14680064),
4447
- (child$36.return = completedWork),
4448
- (child$36 = child$36.sibling);
4449
- else
4450
- for (child$36 = completedWork.child; null !== child$36; )
4451
- (newChildLanes |= child$36.lanes | child$36.childLanes),
4452
- (subtreeFlags |= child$36.subtreeFlags),
4453
- (subtreeFlags |= child$36.flags),
4454
- (child$36.return = completedWork),
4455
- (child$36 = child$36.sibling);
4456
- completedWork.subtreeFlags |= subtreeFlags;
4457
- completedWork.childLanes = newChildLanes;
4458
- return didBailout;
4459
- }
4460
- function completeWork(current, workInProgress, renderLanes) {
4461
- var newProps = workInProgress.pendingProps;
4462
- popTreeContext(workInProgress);
4463
- switch (workInProgress.tag) {
4464
- case 2:
4465
- case 16:
4466
- case 15:
4467
- case 0:
4468
- case 11:
4469
- case 7:
4470
- case 8:
4471
- case 12:
4472
- case 9:
4473
- case 14:
4474
- return bubbleProperties(workInProgress), null;
4475
- case 1:
4476
- return (
4477
- isContextProvider(workInProgress.type) && popContext(),
4478
- bubbleProperties(workInProgress),
4479
- null
4480
- );
4481
- case 3:
4482
- return (
4483
- (newProps = workInProgress.stateNode),
4484
- popHostContainer(),
4485
- pop(didPerformWorkStackCursor),
4486
- pop(contextStackCursor),
4487
- resetWorkInProgressVersions(),
4488
- newProps.pendingContext &&
4489
- ((newProps.context = newProps.pendingContext),
4490
- (newProps.pendingContext = null)),
4491
- (null !== current && null !== current.child) ||
4492
- null === current ||
4493
- (current.memoizedState.isDehydrated &&
4494
- 0 === (workInProgress.flags & 256)) ||
4495
- (workInProgress.flags |= 1024),
4496
- updateHostContainer(current, workInProgress),
4497
- bubbleProperties(workInProgress),
4498
- null
4499
- );
4500
- case 5:
4501
- popHostContext(workInProgress);
4502
- renderLanes = requiredContext(rootInstanceStackCursor.current);
4503
- var type = workInProgress.type;
4504
- if (null !== current && null != workInProgress.stateNode)
4505
- updateHostComponent(
4506
- current,
4507
- workInProgress,
4508
- type,
4509
- newProps,
4510
- renderLanes
4511
- ),
4512
- current.ref !== workInProgress.ref && (workInProgress.flags |= 512);
4513
- else {
4514
- if (!newProps) {
4515
- if (null === workInProgress.stateNode)
4516
- throw Error(
4517
- "We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue."
4518
- );
4519
- bubbleProperties(workInProgress);
4520
- return null;
4521
- }
4522
- requiredContext(contextStackCursor$1.current);
4523
- current = nextReactTag;
4524
- nextReactTag += 2;
4525
- type = getViewConfigForType(type);
4526
- var updatePayload = diffProperties(
4527
- null,
4528
- emptyObject,
4529
- newProps,
4530
- type.validAttributes
4531
- );
4532
- renderLanes = createNode(
4533
- current,
4534
- type.uiViewClassName,
4535
- renderLanes,
4536
- updatePayload,
4537
- workInProgress
4538
- );
4539
- current = new ReactFabricHostComponent(
4540
- current,
4541
- type,
4542
- newProps,
4543
- workInProgress
4544
- );
4545
- current = { node: renderLanes, canonical: current };
4546
- appendAllChildren(current, workInProgress, !1, !1);
4547
- workInProgress.stateNode = current;
4548
- null !== workInProgress.ref && (workInProgress.flags |= 512);
4549
- }
4550
- bubbleProperties(workInProgress);
4551
- return null;
4552
- case 6:
4553
- if (current && null != workInProgress.stateNode)
4554
- updateHostText(
4555
- current,
4556
- workInProgress,
4557
- current.memoizedProps,
4558
- newProps
4559
- );
4560
- else {
4561
- if ("string" !== typeof newProps && null === workInProgress.stateNode)
4562
- throw Error(
4563
- "We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue."
4564
- );
4565
- current = requiredContext(rootInstanceStackCursor.current);
4566
- renderLanes = requiredContext(contextStackCursor$1.current);
4567
- workInProgress.stateNode = createTextInstance(
4568
- newProps,
4569
- current,
4570
- renderLanes,
4571
- workInProgress
4572
- );
4573
- }
4574
- bubbleProperties(workInProgress);
4575
- return null;
4576
- case 13:
4577
- pop(suspenseStackCursor);
4578
- newProps = workInProgress.memoizedState;
4579
- if (0 !== (workInProgress.flags & 128))
4580
- return (workInProgress.lanes = renderLanes), workInProgress;
4581
- renderLanes = !1;
4582
- null !== current && (renderLanes = null !== current.memoizedState);
4583
- null === newProps ||
4584
- renderLanes ||
4585
- ((workInProgress.child.flags |= 8192),
4586
- 0 !== (workInProgress.mode & 1) &&
4587
- (null === current || 0 !== (suspenseStackCursor.current & 1)
4588
- ? 0 === workInProgressRootExitStatus &&
4589
- (workInProgressRootExitStatus = 3)
4590
- : renderDidSuspendDelayIfPossible()));
4591
- null !== workInProgress.updateQueue && (workInProgress.flags |= 4);
4592
- bubbleProperties(workInProgress);
4593
- return null;
4594
- case 4:
4595
- return (
4596
- popHostContainer(),
4597
- updateHostContainer(current, workInProgress),
4598
- bubbleProperties(workInProgress),
4599
- null
4600
- );
4601
- case 10:
4602
- return (
4603
- popProvider(workInProgress.type._context),
4604
- bubbleProperties(workInProgress),
4605
- null
4606
- );
4607
- case 17:
4608
- return (
4609
- isContextProvider(workInProgress.type) && popContext(),
4610
- bubbleProperties(workInProgress),
4611
- null
4612
- );
4613
- case 19:
4614
- pop(suspenseStackCursor);
4615
- type = workInProgress.memoizedState;
4616
- if (null === type) return bubbleProperties(workInProgress), null;
4617
- newProps = 0 !== (workInProgress.flags & 128);
4618
- updatePayload = type.rendering;
4619
- if (null === updatePayload)
4620
- if (newProps) cutOffTailIfNeeded(type, !1);
4621
- else {
4622
- if (
4623
- 0 !== workInProgressRootExitStatus ||
4624
- (null !== current && 0 !== (current.flags & 128))
4625
- )
4626
- for (current = workInProgress.child; null !== current; ) {
4627
- updatePayload = findFirstSuspended(current);
4628
- if (null !== updatePayload) {
4629
- workInProgress.flags |= 128;
4630
- cutOffTailIfNeeded(type, !1);
4631
- current = updatePayload.updateQueue;
4632
- null !== current &&
4633
- ((workInProgress.updateQueue = current),
4634
- (workInProgress.flags |= 4));
4635
- workInProgress.subtreeFlags = 0;
4636
- current = renderLanes;
4637
- for (newProps = workInProgress.child; null !== newProps; )
4638
- (renderLanes = newProps),
4639
- (type = current),
4640
- (renderLanes.flags &= 14680066),
4641
- (updatePayload = renderLanes.alternate),
4642
- null === updatePayload
4643
- ? ((renderLanes.childLanes = 0),
4644
- (renderLanes.lanes = type),
4645
- (renderLanes.child = null),
4646
- (renderLanes.subtreeFlags = 0),
4647
- (renderLanes.memoizedProps = null),
4648
- (renderLanes.memoizedState = null),
4649
- (renderLanes.updateQueue = null),
4650
- (renderLanes.dependencies = null),
4651
- (renderLanes.stateNode = null))
4652
- : ((renderLanes.childLanes = updatePayload.childLanes),
4653
- (renderLanes.lanes = updatePayload.lanes),
4654
- (renderLanes.child = updatePayload.child),
4655
- (renderLanes.subtreeFlags = 0),
4656
- (renderLanes.deletions = null),
4657
- (renderLanes.memoizedProps =
4658
- updatePayload.memoizedProps),
4659
- (renderLanes.memoizedState =
4660
- updatePayload.memoizedState),
4661
- (renderLanes.updateQueue = updatePayload.updateQueue),
4662
- (renderLanes.type = updatePayload.type),
4663
- (type = updatePayload.dependencies),
4664
- (renderLanes.dependencies =
4665
- null === type
4666
- ? null
4667
- : {
4668
- lanes: type.lanes,
4669
- firstContext: type.firstContext
4670
- })),
4671
- (newProps = newProps.sibling);
4672
- push(
4673
- suspenseStackCursor,
4674
- (suspenseStackCursor.current & 1) | 2
4675
- );
4676
- return workInProgress.child;
4677
- }
4678
- current = current.sibling;
4679
- }
4680
- null !== type.tail &&
4681
- now() > workInProgressRootRenderTargetTime &&
4682
- ((workInProgress.flags |= 128),
4683
- (newProps = !0),
4684
- cutOffTailIfNeeded(type, !1),
4685
- (workInProgress.lanes = 4194304));
4686
- }
4687
- else {
4688
- if (!newProps)
4689
- if (
4690
- ((current = findFirstSuspended(updatePayload)), null !== current)
4691
- ) {
4692
- if (
4693
- ((workInProgress.flags |= 128),
4694
- (newProps = !0),
4695
- (current = current.updateQueue),
4696
- null !== current &&
4697
- ((workInProgress.updateQueue = current),
4698
- (workInProgress.flags |= 4)),
4699
- cutOffTailIfNeeded(type, !0),
4700
- null === type.tail &&
4701
- "hidden" === type.tailMode &&
4702
- !updatePayload.alternate)
4703
- )
4704
- return bubbleProperties(workInProgress), null;
4705
- } else
4706
- 2 * now() - type.renderingStartTime >
4707
- workInProgressRootRenderTargetTime &&
4708
- 1073741824 !== renderLanes &&
4709
- ((workInProgress.flags |= 128),
4710
- (newProps = !0),
4711
- cutOffTailIfNeeded(type, !1),
4712
- (workInProgress.lanes = 4194304));
4713
- type.isBackwards
4714
- ? ((updatePayload.sibling = workInProgress.child),
4715
- (workInProgress.child = updatePayload))
4716
- : ((current = type.last),
4717
- null !== current
4718
- ? (current.sibling = updatePayload)
4719
- : (workInProgress.child = updatePayload),
4720
- (type.last = updatePayload));
4721
- }
4722
- if (null !== type.tail)
4723
- return (
4724
- (workInProgress = type.tail),
4725
- (type.rendering = workInProgress),
4726
- (type.tail = workInProgress.sibling),
4727
- (type.renderingStartTime = now()),
4728
- (workInProgress.sibling = null),
4729
- (current = suspenseStackCursor.current),
4730
- push(suspenseStackCursor, newProps ? (current & 1) | 2 : current & 1),
4731
- workInProgress
4732
- );
4733
- bubbleProperties(workInProgress);
4734
- return null;
4735
- case 22:
4736
- case 23:
4737
- return (
4738
- popRenderLanes(),
4739
- (newProps = null !== workInProgress.memoizedState),
4740
- null !== current &&
4741
- (null !== current.memoizedState) !== newProps &&
4742
- (workInProgress.flags |= 8192),
4743
- newProps && 0 !== (workInProgress.mode & 1)
4744
- ? 0 !== (subtreeRenderLanes & 1073741824) &&
4745
- bubbleProperties(workInProgress)
4746
- : bubbleProperties(workInProgress),
4747
- null
4748
- );
4749
- case 24:
4750
- return null;
4751
- case 25:
4752
- return null;
4753
- }
4754
- throw Error(
4755
- "Unknown unit of work tag (" +
4756
- workInProgress.tag +
4757
- "). This error is likely caused by a bug in React. Please file an issue."
4758
- );
4759
- }
4760
- var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner,
4761
- didReceiveUpdate = !1;
4762
- function reconcileChildren(current, workInProgress, nextChildren, renderLanes) {
4763
- workInProgress.child =
4764
- null === current
4765
- ? mountChildFibers(workInProgress, null, nextChildren, renderLanes)
4766
- : reconcileChildFibers(
4767
- workInProgress,
4768
- current.child,
4769
- nextChildren,
4770
- renderLanes
4771
- );
4772
- }
4773
- function updateForwardRef(
4774
- current,
4775
- workInProgress,
4776
- Component,
4777
- nextProps,
4778
- renderLanes
4779
- ) {
4780
- Component = Component.render;
4781
- var ref = workInProgress.ref;
4782
- prepareToReadContext(workInProgress, renderLanes);
4783
- nextProps = renderWithHooks(
4784
- current,
4785
- workInProgress,
4786
- Component,
4787
- nextProps,
4788
- ref,
4789
- renderLanes
4790
- );
4791
- if (null !== current && !didReceiveUpdate)
4792
- return (
4793
- (workInProgress.updateQueue = current.updateQueue),
4794
- (workInProgress.flags &= -2053),
4795
- (current.lanes &= ~renderLanes),
4796
- bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes)
4797
- );
4798
- workInProgress.flags |= 1;
4799
- reconcileChildren(current, workInProgress, nextProps, renderLanes);
4800
- return workInProgress.child;
4801
- }
4802
- function updateMemoComponent(
4803
- current,
4804
- workInProgress,
4805
- Component,
4806
- nextProps,
4807
- renderLanes
4808
- ) {
4809
- if (null === current) {
4810
- var type = Component.type;
4811
- if (
4812
- "function" === typeof type &&
4813
- !shouldConstruct(type) &&
4814
- void 0 === type.defaultProps &&
4815
- null === Component.compare &&
4816
- void 0 === Component.defaultProps
4817
- )
4818
- return (
4819
- (workInProgress.tag = 15),
4820
- (workInProgress.type = type),
4821
- updateSimpleMemoComponent(
4822
- current,
4823
- workInProgress,
4824
- type,
4825
- nextProps,
4826
- renderLanes
4827
- )
4828
- );
4829
- current = createFiberFromTypeAndProps(
4830
- Component.type,
4831
- null,
4832
- nextProps,
4833
- workInProgress,
4834
- workInProgress.mode,
4835
- renderLanes
4836
- );
4837
- current.ref = workInProgress.ref;
4838
- current.return = workInProgress;
4839
- return (workInProgress.child = current);
4840
- }
4841
- type = current.child;
4842
- if (0 === (current.lanes & renderLanes)) {
4843
- var prevProps = type.memoizedProps;
4844
- Component = Component.compare;
4845
- Component = null !== Component ? Component : shallowEqual;
4846
- if (Component(prevProps, nextProps) && current.ref === workInProgress.ref)
4847
- return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes);
4368
+ type = current.child;
4369
+ if (0 === (current.lanes & renderLanes)) {
4370
+ var prevProps = type.memoizedProps;
4371
+ Component = Component.compare;
4372
+ Component = null !== Component ? Component : shallowEqual;
4373
+ if (Component(prevProps, nextProps) && current.ref === workInProgress.ref)
4374
+ return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes);
4848
4375
  }
4849
4376
  workInProgress.flags |= 1;
4850
4377
  current = createWorkInProgress(type, nextProps);
@@ -4859,18 +4386,24 @@ function updateSimpleMemoComponent(
4859
4386
  nextProps,
4860
4387
  renderLanes
4861
4388
  ) {
4862
- if (
4863
- null !== current &&
4864
- shallowEqual(current.memoizedProps, nextProps) &&
4865
- current.ref === workInProgress.ref
4866
- )
4867
- if (((didReceiveUpdate = !1), 0 !== (current.lanes & renderLanes)))
4868
- 0 !== (current.flags & 131072) && (didReceiveUpdate = !0);
4869
- else
4870
- return (
4871
- (workInProgress.lanes = current.lanes),
4872
- bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes)
4873
- );
4389
+ if (null !== current) {
4390
+ var prevProps = current.memoizedProps;
4391
+ if (
4392
+ shallowEqual(prevProps, nextProps) &&
4393
+ current.ref === workInProgress.ref
4394
+ )
4395
+ if (
4396
+ ((didReceiveUpdate = !1),
4397
+ (workInProgress.pendingProps = nextProps = prevProps),
4398
+ 0 !== (current.lanes & renderLanes))
4399
+ )
4400
+ 0 !== (current.flags & 131072) && (didReceiveUpdate = !0);
4401
+ else
4402
+ return (
4403
+ (workInProgress.lanes = current.lanes),
4404
+ bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes)
4405
+ );
4406
+ }
4874
4407
  return updateFunctionComponent(
4875
4408
  current,
4876
4409
  workInProgress,
@@ -4885,7 +4418,11 @@ function updateOffscreenComponent(current, workInProgress, renderLanes) {
4885
4418
  prevState = null !== current ? current.memoizedState : null;
4886
4419
  if ("hidden" === nextProps.mode)
4887
4420
  if (0 === (workInProgress.mode & 1))
4888
- (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }),
4421
+ (workInProgress.memoizedState = {
4422
+ baseLanes: 0,
4423
+ cachePool: null,
4424
+ transitions: null
4425
+ }),
4889
4426
  push(subtreeRenderLanesCursor, subtreeRenderLanes),
4890
4427
  (subtreeRenderLanes |= renderLanes);
4891
4428
  else {
@@ -4898,14 +4435,19 @@ function updateOffscreenComponent(current, workInProgress, renderLanes) {
4898
4435
  (workInProgress.lanes = workInProgress.childLanes = 1073741824),
4899
4436
  (workInProgress.memoizedState = {
4900
4437
  baseLanes: current,
4901
- cachePool: null
4438
+ cachePool: null,
4439
+ transitions: null
4902
4440
  }),
4903
4441
  (workInProgress.updateQueue = null),
4904
4442
  push(subtreeRenderLanesCursor, subtreeRenderLanes),
4905
4443
  (subtreeRenderLanes |= current),
4906
4444
  null
4907
4445
  );
4908
- workInProgress.memoizedState = { baseLanes: 0, cachePool: null };
4446
+ workInProgress.memoizedState = {
4447
+ baseLanes: 0,
4448
+ cachePool: null,
4449
+ transitions: null
4450
+ };
4909
4451
  nextProps = null !== prevState ? prevState.baseLanes : renderLanes;
4910
4452
  push(subtreeRenderLanesCursor, subtreeRenderLanes);
4911
4453
  subtreeRenderLanes |= nextProps;
@@ -4920,7 +4462,7 @@ function updateOffscreenComponent(current, workInProgress, renderLanes) {
4920
4462
  reconcileChildren(current, workInProgress, nextChildren, renderLanes);
4921
4463
  return workInProgress.child;
4922
4464
  }
4923
- function markRef$1(current, workInProgress) {
4465
+ function markRef(current, workInProgress) {
4924
4466
  var ref = workInProgress.ref;
4925
4467
  if (
4926
4468
  (null === current && null !== ref) ||
@@ -4972,10 +4514,7 @@ function updateClassComponent(
4972
4514
  } else hasContext = !1;
4973
4515
  prepareToReadContext(workInProgress, renderLanes);
4974
4516
  if (null === workInProgress.stateNode)
4975
- null !== current &&
4976
- ((current.alternate = null),
4977
- (workInProgress.alternate = null),
4978
- (workInProgress.flags |= 2)),
4517
+ resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress),
4979
4518
  constructClassInstance(workInProgress, Component, nextProps),
4980
4519
  mountClassInstance(workInProgress, Component, nextProps, renderLanes),
4981
4520
  (nextProps = !0);
@@ -5169,7 +4708,7 @@ function finishClassComponent(
5169
4708
  hasContext,
5170
4709
  renderLanes
5171
4710
  ) {
5172
- markRef$1(current, workInProgress);
4711
+ markRef(current, workInProgress);
5173
4712
  var didCaptureError = 0 !== (workInProgress.flags & 128);
5174
4713
  if (!shouldUpdate && !didCaptureError)
5175
4714
  return (
@@ -5215,14 +4754,15 @@ function pushHostRootContext(workInProgress) {
5215
4754
  }
5216
4755
  var SUSPENDED_MARKER = { dehydrated: null, treeContext: null, retryLane: 0 };
5217
4756
  function mountSuspenseOffscreenState(renderLanes) {
5218
- return { baseLanes: renderLanes, cachePool: null };
4757
+ return { baseLanes: renderLanes, cachePool: null, transitions: null };
5219
4758
  }
5220
4759
  function updateSuspenseComponent(current, workInProgress, renderLanes) {
5221
4760
  var nextProps = workInProgress.pendingProps,
5222
4761
  suspenseContext = suspenseStackCursor.current,
5223
4762
  showFallback = !1,
4763
+ didSuspend = 0 !== (workInProgress.flags & 128),
5224
4764
  JSCompiler_temp;
5225
- (JSCompiler_temp = 0 !== (workInProgress.flags & 128)) ||
4765
+ (JSCompiler_temp = didSuspend) ||
5226
4766
  (JSCompiler_temp =
5227
4767
  null !== current && null === current.memoizedState
5228
4768
  ? !1
@@ -5232,167 +4772,297 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) {
5232
4772
  suspenseContext |= 1;
5233
4773
  push(suspenseStackCursor, suspenseContext & 1);
5234
4774
  if (null === current) {
5235
- suspenseContext = nextProps.children;
5236
- current = nextProps.fallback;
5237
- if (showFallback)
4775
+ current = workInProgress.memoizedState;
4776
+ if (null !== current && null !== current.dehydrated)
5238
4777
  return (
5239
- (showFallback = workInProgress.mode),
5240
- (nextProps = workInProgress.child),
5241
- (suspenseContext = { mode: "hidden", children: suspenseContext }),
5242
- 0 === (showFallback & 1) && null !== nextProps
5243
- ? ((nextProps.childLanes = 0),
5244
- (nextProps.pendingProps = suspenseContext))
5245
- : (nextProps = createFiberFromOffscreen(
5246
- suspenseContext,
5247
- showFallback,
4778
+ 0 === (workInProgress.mode & 1)
4779
+ ? (workInProgress.lanes = 1)
4780
+ : shim$1()
4781
+ ? (workInProgress.lanes = 8)
4782
+ : (workInProgress.lanes = 1073741824),
4783
+ null
4784
+ );
4785
+ didSuspend = nextProps.children;
4786
+ current = nextProps.fallback;
4787
+ return showFallback
4788
+ ? ((nextProps = workInProgress.mode),
4789
+ (showFallback = workInProgress.child),
4790
+ (didSuspend = { mode: "hidden", children: didSuspend }),
4791
+ 0 === (nextProps & 1) && null !== showFallback
4792
+ ? ((showFallback.childLanes = 0),
4793
+ (showFallback.pendingProps = didSuspend))
4794
+ : (showFallback = createFiberFromOffscreen(
4795
+ didSuspend,
4796
+ nextProps,
5248
4797
  0,
5249
4798
  null
5250
4799
  )),
5251
4800
  (current = createFiberFromFragment(
5252
4801
  current,
5253
- showFallback,
4802
+ nextProps,
5254
4803
  renderLanes,
5255
4804
  null
5256
4805
  )),
5257
- (nextProps.return = workInProgress),
4806
+ (showFallback.return = workInProgress),
5258
4807
  (current.return = workInProgress),
5259
- (nextProps.sibling = current),
5260
- (workInProgress.child = nextProps),
4808
+ (showFallback.sibling = current),
4809
+ (workInProgress.child = showFallback),
5261
4810
  (workInProgress.child.memoizedState = mountSuspenseOffscreenState(
5262
4811
  renderLanes
5263
4812
  )),
5264
4813
  (workInProgress.memoizedState = SUSPENDED_MARKER),
5265
- current
5266
- );
5267
- renderLanes = createFiberFromOffscreen(
5268
- { mode: "visible", children: suspenseContext },
5269
- workInProgress.mode,
5270
- 0,
5271
- null
5272
- );
5273
- renderLanes.return = workInProgress;
5274
- return (workInProgress.child = renderLanes);
4814
+ current)
4815
+ : mountSuspensePrimaryChildren(workInProgress, didSuspend);
5275
4816
  }
5276
- if (null !== current.memoizedState) {
5277
- if (showFallback)
5278
- return (
5279
- (showFallback = updateSuspenseFallbackChildren(
5280
- current,
5281
- workInProgress,
5282
- nextProps.children,
5283
- nextProps.fallback,
5284
- renderLanes
5285
- )),
5286
- (nextProps = workInProgress.child),
5287
- (suspenseContext = current.child.memoizedState),
5288
- (nextProps.memoizedState =
5289
- null === suspenseContext
5290
- ? mountSuspenseOffscreenState(renderLanes)
5291
- : {
5292
- baseLanes: suspenseContext.baseLanes | renderLanes,
5293
- cachePool: null
5294
- }),
5295
- (nextProps.childLanes = current.childLanes & ~renderLanes),
5296
- (workInProgress.memoizedState = SUSPENDED_MARKER),
5297
- showFallback
5298
- );
5299
- renderLanes = updateSuspensePrimaryChildren(
4817
+ suspenseContext = current.memoizedState;
4818
+ if (
4819
+ null !== suspenseContext &&
4820
+ ((JSCompiler_temp = suspenseContext.dehydrated), null !== JSCompiler_temp)
4821
+ )
4822
+ return updateDehydratedSuspenseComponent(
5300
4823
  current,
5301
4824
  workInProgress,
5302
- nextProps.children,
4825
+ didSuspend,
4826
+ nextProps,
4827
+ JSCompiler_temp,
4828
+ suspenseContext,
5303
4829
  renderLanes
5304
4830
  );
5305
- workInProgress.memoizedState = null;
5306
- return renderLanes;
4831
+ if (showFallback) {
4832
+ showFallback = nextProps.fallback;
4833
+ didSuspend = workInProgress.mode;
4834
+ suspenseContext = current.child;
4835
+ JSCompiler_temp = suspenseContext.sibling;
4836
+ var primaryChildProps = { mode: "hidden", children: nextProps.children };
4837
+ 0 === (didSuspend & 1) && workInProgress.child !== suspenseContext
4838
+ ? ((nextProps = workInProgress.child),
4839
+ (nextProps.childLanes = 0),
4840
+ (nextProps.pendingProps = primaryChildProps),
4841
+ (workInProgress.deletions = null))
4842
+ : ((nextProps = createWorkInProgress(suspenseContext, primaryChildProps)),
4843
+ (nextProps.subtreeFlags = suspenseContext.subtreeFlags & 14680064));
4844
+ null !== JSCompiler_temp
4845
+ ? (showFallback = createWorkInProgress(JSCompiler_temp, showFallback))
4846
+ : ((showFallback = createFiberFromFragment(
4847
+ showFallback,
4848
+ didSuspend,
4849
+ renderLanes,
4850
+ null
4851
+ )),
4852
+ (showFallback.flags |= 2));
4853
+ showFallback.return = workInProgress;
4854
+ nextProps.return = workInProgress;
4855
+ nextProps.sibling = showFallback;
4856
+ workInProgress.child = nextProps;
4857
+ nextProps = showFallback;
4858
+ showFallback = workInProgress.child;
4859
+ didSuspend = current.child.memoizedState;
4860
+ didSuspend =
4861
+ null === didSuspend
4862
+ ? mountSuspenseOffscreenState(renderLanes)
4863
+ : {
4864
+ baseLanes: didSuspend.baseLanes | renderLanes,
4865
+ cachePool: null,
4866
+ transitions: didSuspend.transitions
4867
+ };
4868
+ showFallback.memoizedState = didSuspend;
4869
+ showFallback.childLanes = current.childLanes & ~renderLanes;
4870
+ workInProgress.memoizedState = SUSPENDED_MARKER;
4871
+ return nextProps;
5307
4872
  }
5308
- if (showFallback)
5309
- return (
5310
- (showFallback = updateSuspenseFallbackChildren(
5311
- current,
5312
- workInProgress,
5313
- nextProps.children,
5314
- nextProps.fallback,
5315
- renderLanes
5316
- )),
5317
- (nextProps = workInProgress.child),
5318
- (suspenseContext = current.child.memoizedState),
5319
- (nextProps.memoizedState =
5320
- null === suspenseContext
5321
- ? mountSuspenseOffscreenState(renderLanes)
5322
- : {
5323
- baseLanes: suspenseContext.baseLanes | renderLanes,
5324
- cachePool: null
5325
- }),
5326
- (nextProps.childLanes = current.childLanes & ~renderLanes),
5327
- (workInProgress.memoizedState = SUSPENDED_MARKER),
5328
- showFallback
5329
- );
5330
- renderLanes = updateSuspensePrimaryChildren(
5331
- current,
5332
- workInProgress,
5333
- nextProps.children,
5334
- renderLanes
5335
- );
5336
- workInProgress.memoizedState = null;
5337
- return renderLanes;
5338
- }
5339
- function updateSuspensePrimaryChildren(
5340
- current,
5341
- workInProgress,
5342
- primaryChildren,
5343
- renderLanes
5344
- ) {
5345
- var currentPrimaryChildFragment = current.child;
5346
- current = currentPrimaryChildFragment.sibling;
5347
- primaryChildren = createWorkInProgress(currentPrimaryChildFragment, {
4873
+ showFallback = current.child;
4874
+ current = showFallback.sibling;
4875
+ nextProps = createWorkInProgress(showFallback, {
5348
4876
  mode: "visible",
5349
- children: primaryChildren
4877
+ children: nextProps.children
5350
4878
  });
5351
- 0 === (workInProgress.mode & 1) && (primaryChildren.lanes = renderLanes);
5352
- primaryChildren.return = workInProgress;
5353
- primaryChildren.sibling = null;
4879
+ 0 === (workInProgress.mode & 1) && (nextProps.lanes = renderLanes);
4880
+ nextProps.return = workInProgress;
4881
+ nextProps.sibling = null;
5354
4882
  null !== current &&
5355
4883
  ((renderLanes = workInProgress.deletions),
5356
4884
  null === renderLanes
5357
4885
  ? ((workInProgress.deletions = [current]), (workInProgress.flags |= 16))
5358
4886
  : renderLanes.push(current));
4887
+ workInProgress.child = nextProps;
4888
+ workInProgress.memoizedState = null;
4889
+ return nextProps;
4890
+ }
4891
+ function mountSuspensePrimaryChildren(workInProgress, primaryChildren) {
4892
+ primaryChildren = createFiberFromOffscreen(
4893
+ { mode: "visible", children: primaryChildren },
4894
+ workInProgress.mode,
4895
+ 0,
4896
+ null
4897
+ );
4898
+ primaryChildren.return = workInProgress;
5359
4899
  return (workInProgress.child = primaryChildren);
5360
4900
  }
5361
- function updateSuspenseFallbackChildren(
4901
+ function retrySuspenseComponentWithoutHydrating(
5362
4902
  current,
5363
4903
  workInProgress,
5364
- primaryChildren,
5365
- fallbackChildren,
4904
+ renderLanes,
4905
+ recoverableError
4906
+ ) {
4907
+ null !== recoverableError &&
4908
+ (null === hydrationErrors
4909
+ ? (hydrationErrors = [recoverableError])
4910
+ : hydrationErrors.push(recoverableError));
4911
+ reconcileChildFibers(workInProgress, current.child, null, renderLanes);
4912
+ current = mountSuspensePrimaryChildren(
4913
+ workInProgress,
4914
+ workInProgress.pendingProps.children
4915
+ );
4916
+ current.flags |= 2;
4917
+ workInProgress.memoizedState = null;
4918
+ return current;
4919
+ }
4920
+ function updateDehydratedSuspenseComponent(
4921
+ current,
4922
+ workInProgress,
4923
+ didSuspend,
4924
+ nextProps,
4925
+ suspenseInstance,
4926
+ suspenseState,
5366
4927
  renderLanes
5367
4928
  ) {
5368
- var mode = workInProgress.mode;
5369
- current = current.child;
5370
- var currentFallbackChildFragment = current.sibling,
5371
- primaryChildProps = { mode: "hidden", children: primaryChildren };
5372
- 0 === (mode & 1) && workInProgress.child !== current
5373
- ? ((primaryChildren = workInProgress.child),
5374
- (primaryChildren.childLanes = 0),
5375
- (primaryChildren.pendingProps = primaryChildProps),
5376
- (workInProgress.deletions = null))
5377
- : ((primaryChildren = createWorkInProgress(current, primaryChildProps)),
5378
- (primaryChildren.subtreeFlags = current.subtreeFlags & 14680064));
5379
- null !== currentFallbackChildFragment
5380
- ? (fallbackChildren = createWorkInProgress(
5381
- currentFallbackChildFragment,
5382
- fallbackChildren
5383
- ))
5384
- : ((fallbackChildren = createFiberFromFragment(
5385
- fallbackChildren,
5386
- mode,
4929
+ if (didSuspend) {
4930
+ if (workInProgress.flags & 256)
4931
+ return (
4932
+ (workInProgress.flags &= -257),
4933
+ retrySuspenseComponentWithoutHydrating(
4934
+ current,
4935
+ workInProgress,
4936
+ renderLanes,
4937
+ Error(
4938
+ "There was an error while hydrating this Suspense boundary. Switched to client rendering."
4939
+ )
4940
+ )
4941
+ );
4942
+ if (null !== workInProgress.memoizedState)
4943
+ return (
4944
+ (workInProgress.child = current.child),
4945
+ (workInProgress.flags |= 128),
4946
+ null
4947
+ );
4948
+ suspenseState = nextProps.fallback;
4949
+ didSuspend = workInProgress.mode;
4950
+ nextProps = createFiberFromOffscreen(
4951
+ { mode: "visible", children: nextProps.children },
4952
+ didSuspend,
4953
+ 0,
4954
+ null
4955
+ );
4956
+ suspenseState = createFiberFromFragment(
4957
+ suspenseState,
4958
+ didSuspend,
4959
+ renderLanes,
4960
+ null
4961
+ );
4962
+ suspenseState.flags |= 2;
4963
+ nextProps.return = workInProgress;
4964
+ suspenseState.return = workInProgress;
4965
+ nextProps.sibling = suspenseState;
4966
+ workInProgress.child = nextProps;
4967
+ 0 !== (workInProgress.mode & 1) &&
4968
+ reconcileChildFibers(workInProgress, current.child, null, renderLanes);
4969
+ workInProgress.child.memoizedState = mountSuspenseOffscreenState(
4970
+ renderLanes
4971
+ );
4972
+ workInProgress.memoizedState = SUSPENDED_MARKER;
4973
+ return suspenseState;
4974
+ }
4975
+ if (0 === (workInProgress.mode & 1))
4976
+ return retrySuspenseComponentWithoutHydrating(
4977
+ current,
4978
+ workInProgress,
4979
+ renderLanes,
4980
+ null
4981
+ );
4982
+ if (shim$1())
4983
+ return (
4984
+ (suspenseState = shim$1().errorMessage),
4985
+ retrySuspenseComponentWithoutHydrating(
4986
+ current,
4987
+ workInProgress,
5387
4988
  renderLanes,
5388
- null
5389
- )),
5390
- (fallbackChildren.flags |= 2));
5391
- fallbackChildren.return = workInProgress;
5392
- primaryChildren.return = workInProgress;
5393
- primaryChildren.sibling = fallbackChildren;
5394
- workInProgress.child = primaryChildren;
5395
- return fallbackChildren;
4989
+ suspenseState
4990
+ ? Error(suspenseState)
4991
+ : Error(
4992
+ "The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering."
4993
+ )
4994
+ )
4995
+ );
4996
+ didSuspend = 0 !== (renderLanes & current.childLanes);
4997
+ if (didReceiveUpdate || didSuspend) {
4998
+ nextProps = workInProgressRoot;
4999
+ if (null !== nextProps) {
5000
+ switch (renderLanes & -renderLanes) {
5001
+ case 4:
5002
+ didSuspend = 2;
5003
+ break;
5004
+ case 16:
5005
+ didSuspend = 8;
5006
+ break;
5007
+ case 64:
5008
+ case 128:
5009
+ case 256:
5010
+ case 512:
5011
+ case 1024:
5012
+ case 2048:
5013
+ case 4096:
5014
+ case 8192:
5015
+ case 16384:
5016
+ case 32768:
5017
+ case 65536:
5018
+ case 131072:
5019
+ case 262144:
5020
+ case 524288:
5021
+ case 1048576:
5022
+ case 2097152:
5023
+ case 4194304:
5024
+ case 8388608:
5025
+ case 16777216:
5026
+ case 33554432:
5027
+ case 67108864:
5028
+ didSuspend = 32;
5029
+ break;
5030
+ case 536870912:
5031
+ didSuspend = 268435456;
5032
+ break;
5033
+ default:
5034
+ didSuspend = 0;
5035
+ }
5036
+ nextProps =
5037
+ 0 !== (didSuspend & (nextProps.suspendedLanes | renderLanes))
5038
+ ? 0
5039
+ : didSuspend;
5040
+ 0 !== nextProps &&
5041
+ nextProps !== suspenseState.retryLane &&
5042
+ ((suspenseState.retryLane = nextProps),
5043
+ scheduleUpdateOnFiber(current, nextProps, -1));
5044
+ }
5045
+ renderDidSuspendDelayIfPossible();
5046
+ return retrySuspenseComponentWithoutHydrating(
5047
+ current,
5048
+ workInProgress,
5049
+ renderLanes,
5050
+ Error(
5051
+ "This Suspense boundary received an update before it finished hydrating. This caused the boundary to switch to client rendering. The usual way to fix this is to wrap the original update in startTransition."
5052
+ )
5053
+ );
5054
+ }
5055
+ if (shim$1())
5056
+ return (
5057
+ (workInProgress.flags |= 128),
5058
+ (workInProgress.child = current.child),
5059
+ retryDehydratedSuspenseBoundary.bind(null, current),
5060
+ shim$1(),
5061
+ null
5062
+ );
5063
+ current = mountSuspensePrimaryChildren(workInProgress, nextProps.children);
5064
+ current.flags |= 4096;
5065
+ return current;
5396
5066
  }
5397
5067
  function scheduleSuspenseWorkOnFiber(fiber, renderLanes, propagationRoot) {
5398
5068
  fiber.lanes |= renderLanes;
@@ -5511,6 +5181,13 @@ function updateSuspenseListComponent(current, workInProgress, renderLanes) {
5511
5181
  }
5512
5182
  return workInProgress.child;
5513
5183
  }
5184
+ function resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress) {
5185
+ 0 === (workInProgress.mode & 1) &&
5186
+ null !== current &&
5187
+ ((current.alternate = null),
5188
+ (workInProgress.alternate = null),
5189
+ (workInProgress.flags |= 2));
5190
+ }
5514
5191
  function bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) {
5515
5192
  null !== current && (workInProgress.dependencies = current.dependencies);
5516
5193
  workInProgressRootSkippedLanes |= workInProgress.lanes;
@@ -5530,74 +5207,607 @@ function bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) {
5530
5207
  (renderLanes.return = workInProgress);
5531
5208
  renderLanes.sibling = null;
5532
5209
  }
5533
- return workInProgress.child;
5210
+ return workInProgress.child;
5211
+ }
5212
+ function attemptEarlyBailoutIfNoScheduledUpdate(
5213
+ current,
5214
+ workInProgress,
5215
+ renderLanes
5216
+ ) {
5217
+ switch (workInProgress.tag) {
5218
+ case 3:
5219
+ pushHostRootContext(workInProgress);
5220
+ break;
5221
+ case 5:
5222
+ pushHostContext(workInProgress);
5223
+ break;
5224
+ case 1:
5225
+ isContextProvider(workInProgress.type) &&
5226
+ pushContextProvider(workInProgress);
5227
+ break;
5228
+ case 4:
5229
+ pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo);
5230
+ break;
5231
+ case 10:
5232
+ var context = workInProgress.type._context,
5233
+ nextValue = workInProgress.memoizedProps.value;
5234
+ push(valueCursor, context._currentValue2);
5235
+ context._currentValue2 = nextValue;
5236
+ break;
5237
+ case 13:
5238
+ context = workInProgress.memoizedState;
5239
+ if (null !== context) {
5240
+ if (null !== context.dehydrated)
5241
+ return (
5242
+ push(suspenseStackCursor, suspenseStackCursor.current & 1),
5243
+ (workInProgress.flags |= 128),
5244
+ null
5245
+ );
5246
+ if (0 !== (renderLanes & workInProgress.child.childLanes))
5247
+ return updateSuspenseComponent(current, workInProgress, renderLanes);
5248
+ push(suspenseStackCursor, suspenseStackCursor.current & 1);
5249
+ current = bailoutOnAlreadyFinishedWork(
5250
+ current,
5251
+ workInProgress,
5252
+ renderLanes
5253
+ );
5254
+ return null !== current ? current.sibling : null;
5255
+ }
5256
+ push(suspenseStackCursor, suspenseStackCursor.current & 1);
5257
+ break;
5258
+ case 19:
5259
+ context = 0 !== (renderLanes & workInProgress.childLanes);
5260
+ if (0 !== (current.flags & 128)) {
5261
+ if (context)
5262
+ return updateSuspenseListComponent(
5263
+ current,
5264
+ workInProgress,
5265
+ renderLanes
5266
+ );
5267
+ workInProgress.flags |= 128;
5268
+ }
5269
+ nextValue = workInProgress.memoizedState;
5270
+ null !== nextValue &&
5271
+ ((nextValue.rendering = null),
5272
+ (nextValue.tail = null),
5273
+ (nextValue.lastEffect = null));
5274
+ push(suspenseStackCursor, suspenseStackCursor.current);
5275
+ if (context) break;
5276
+ else return null;
5277
+ case 22:
5278
+ case 23:
5279
+ return (
5280
+ (workInProgress.lanes = 0),
5281
+ updateOffscreenComponent(current, workInProgress, renderLanes)
5282
+ );
5283
+ }
5284
+ return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes);
5285
+ }
5286
+ function hadNoMutationsEffects(current, completedWork) {
5287
+ if (null !== current && current.child === completedWork.child) return !0;
5288
+ if (0 !== (completedWork.flags & 16)) return !1;
5289
+ for (current = completedWork.child; null !== current; ) {
5290
+ if (0 !== (current.flags & 12854) || 0 !== (current.subtreeFlags & 12854))
5291
+ return !1;
5292
+ current = current.sibling;
5293
+ }
5294
+ return !0;
5295
+ }
5296
+ var appendAllChildren,
5297
+ updateHostContainer,
5298
+ updateHostComponent$1,
5299
+ updateHostText$1;
5300
+ appendAllChildren = function(
5301
+ parent,
5302
+ workInProgress,
5303
+ needsVisibilityToggle,
5304
+ isHidden
5305
+ ) {
5306
+ for (var node = workInProgress.child; null !== node; ) {
5307
+ if (5 === node.tag) {
5308
+ var instance = node.stateNode;
5309
+ needsVisibilityToggle &&
5310
+ isHidden &&
5311
+ (instance = cloneHiddenInstance(instance));
5312
+ appendChildNode(parent.node, instance.node);
5313
+ } else if (6 === node.tag) {
5314
+ instance = node.stateNode;
5315
+ if (needsVisibilityToggle && isHidden)
5316
+ throw Error("Not yet implemented.");
5317
+ appendChildNode(parent.node, instance.node);
5318
+ } else if (4 !== node.tag)
5319
+ if (22 === node.tag && null !== node.memoizedState)
5320
+ (instance = node.child),
5321
+ null !== instance && (instance.return = node),
5322
+ appendAllChildren(parent, node, !0, !0);
5323
+ else if (null !== node.child) {
5324
+ node.child.return = node;
5325
+ node = node.child;
5326
+ continue;
5327
+ }
5328
+ if (node === workInProgress) break;
5329
+ for (; null === node.sibling; ) {
5330
+ if (null === node.return || node.return === workInProgress) return;
5331
+ node = node.return;
5332
+ }
5333
+ node.sibling.return = node.return;
5334
+ node = node.sibling;
5335
+ }
5336
+ };
5337
+ function appendAllChildrenToContainer(
5338
+ containerChildSet,
5339
+ workInProgress,
5340
+ needsVisibilityToggle,
5341
+ isHidden
5342
+ ) {
5343
+ for (var node = workInProgress.child; null !== node; ) {
5344
+ if (5 === node.tag) {
5345
+ var instance = node.stateNode;
5346
+ needsVisibilityToggle &&
5347
+ isHidden &&
5348
+ (instance = cloneHiddenInstance(instance));
5349
+ appendChildNodeToSet(containerChildSet, instance.node);
5350
+ } else if (6 === node.tag) {
5351
+ instance = node.stateNode;
5352
+ if (needsVisibilityToggle && isHidden)
5353
+ throw Error("Not yet implemented.");
5354
+ appendChildNodeToSet(containerChildSet, instance.node);
5355
+ } else if (4 !== node.tag)
5356
+ if (22 === node.tag && null !== node.memoizedState)
5357
+ (instance = node.child),
5358
+ null !== instance && (instance.return = node),
5359
+ appendAllChildrenToContainer(containerChildSet, node, !0, !0);
5360
+ else if (null !== node.child) {
5361
+ node.child.return = node;
5362
+ node = node.child;
5363
+ continue;
5364
+ }
5365
+ if (node === workInProgress) break;
5366
+ for (; null === node.sibling; ) {
5367
+ if (null === node.return || node.return === workInProgress) return;
5368
+ node = node.return;
5369
+ }
5370
+ node.sibling.return = node.return;
5371
+ node = node.sibling;
5372
+ }
5373
+ }
5374
+ updateHostContainer = function(current, workInProgress) {
5375
+ var portalOrRoot = workInProgress.stateNode;
5376
+ if (!hadNoMutationsEffects(current, workInProgress)) {
5377
+ current = portalOrRoot.containerInfo;
5378
+ var newChildSet = createChildNodeSet(current);
5379
+ appendAllChildrenToContainer(newChildSet, workInProgress, !1, !1);
5380
+ portalOrRoot.pendingChildren = newChildSet;
5381
+ workInProgress.flags |= 4;
5382
+ completeRoot(current, newChildSet);
5383
+ }
5384
+ };
5385
+ updateHostComponent$1 = function(current, workInProgress, type, newProps) {
5386
+ type = current.stateNode;
5387
+ var oldProps = current.memoizedProps;
5388
+ if (
5389
+ (current = hadNoMutationsEffects(current, workInProgress)) &&
5390
+ oldProps === newProps
5391
+ )
5392
+ workInProgress.stateNode = type;
5393
+ else {
5394
+ var recyclableInstance = workInProgress.stateNode;
5395
+ requiredContext(contextStackCursor$1.current);
5396
+ var updatePayload = null;
5397
+ oldProps !== newProps &&
5398
+ ((oldProps = diffProperties(
5399
+ null,
5400
+ oldProps,
5401
+ newProps,
5402
+ recyclableInstance.canonical.viewConfig.validAttributes
5403
+ )),
5404
+ (recyclableInstance.canonical.currentProps = newProps),
5405
+ (updatePayload = oldProps));
5406
+ current && null === updatePayload
5407
+ ? (workInProgress.stateNode = type)
5408
+ : ((newProps = updatePayload),
5409
+ (oldProps = type.node),
5410
+ (type = {
5411
+ node: current
5412
+ ? null !== newProps
5413
+ ? cloneNodeWithNewProps(oldProps, newProps)
5414
+ : cloneNode(oldProps)
5415
+ : null !== newProps
5416
+ ? cloneNodeWithNewChildrenAndProps(oldProps, newProps)
5417
+ : cloneNodeWithNewChildren(oldProps),
5418
+ canonical: type.canonical
5419
+ }),
5420
+ (workInProgress.stateNode = type),
5421
+ current
5422
+ ? (workInProgress.flags |= 4)
5423
+ : appendAllChildren(type, workInProgress, !1, !1));
5424
+ }
5425
+ };
5426
+ updateHostText$1 = function(current, workInProgress, oldText, newText) {
5427
+ oldText !== newText
5428
+ ? ((current = requiredContext(rootInstanceStackCursor.current)),
5429
+ (oldText = requiredContext(contextStackCursor$1.current)),
5430
+ (workInProgress.stateNode = createTextInstance(
5431
+ newText,
5432
+ current,
5433
+ oldText,
5434
+ workInProgress
5435
+ )),
5436
+ (workInProgress.flags |= 4))
5437
+ : (workInProgress.stateNode = current.stateNode);
5438
+ };
5439
+ function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) {
5440
+ switch (renderState.tailMode) {
5441
+ case "hidden":
5442
+ hasRenderedATailFallback = renderState.tail;
5443
+ for (var lastTailNode = null; null !== hasRenderedATailFallback; )
5444
+ null !== hasRenderedATailFallback.alternate &&
5445
+ (lastTailNode = hasRenderedATailFallback),
5446
+ (hasRenderedATailFallback = hasRenderedATailFallback.sibling);
5447
+ null === lastTailNode
5448
+ ? (renderState.tail = null)
5449
+ : (lastTailNode.sibling = null);
5450
+ break;
5451
+ case "collapsed":
5452
+ lastTailNode = renderState.tail;
5453
+ for (var lastTailNode$60 = null; null !== lastTailNode; )
5454
+ null !== lastTailNode.alternate && (lastTailNode$60 = lastTailNode),
5455
+ (lastTailNode = lastTailNode.sibling);
5456
+ null === lastTailNode$60
5457
+ ? hasRenderedATailFallback || null === renderState.tail
5458
+ ? (renderState.tail = null)
5459
+ : (renderState.tail.sibling = null)
5460
+ : (lastTailNode$60.sibling = null);
5461
+ }
5534
5462
  }
5535
- function attemptEarlyBailoutIfNoScheduledUpdate(
5536
- current,
5537
- workInProgress,
5538
- renderLanes
5539
- ) {
5463
+ function bubbleProperties(completedWork) {
5464
+ var didBailout =
5465
+ null !== completedWork.alternate &&
5466
+ completedWork.alternate.child === completedWork.child,
5467
+ newChildLanes = 0,
5468
+ subtreeFlags = 0;
5469
+ if (didBailout)
5470
+ for (var child$61 = completedWork.child; null !== child$61; )
5471
+ (newChildLanes |= child$61.lanes | child$61.childLanes),
5472
+ (subtreeFlags |= child$61.subtreeFlags & 14680064),
5473
+ (subtreeFlags |= child$61.flags & 14680064),
5474
+ (child$61.return = completedWork),
5475
+ (child$61 = child$61.sibling);
5476
+ else
5477
+ for (child$61 = completedWork.child; null !== child$61; )
5478
+ (newChildLanes |= child$61.lanes | child$61.childLanes),
5479
+ (subtreeFlags |= child$61.subtreeFlags),
5480
+ (subtreeFlags |= child$61.flags),
5481
+ (child$61.return = completedWork),
5482
+ (child$61 = child$61.sibling);
5483
+ completedWork.subtreeFlags |= subtreeFlags;
5484
+ completedWork.childLanes = newChildLanes;
5485
+ return didBailout;
5486
+ }
5487
+ function completeWork(current, workInProgress, renderLanes) {
5488
+ var newProps = workInProgress.pendingProps;
5489
+ popTreeContext(workInProgress);
5540
5490
  switch (workInProgress.tag) {
5491
+ case 2:
5492
+ case 16:
5493
+ case 15:
5494
+ case 0:
5495
+ case 11:
5496
+ case 7:
5497
+ case 8:
5498
+ case 12:
5499
+ case 9:
5500
+ case 14:
5501
+ return bubbleProperties(workInProgress), null;
5502
+ case 1:
5503
+ return (
5504
+ isContextProvider(workInProgress.type) && popContext(),
5505
+ bubbleProperties(workInProgress),
5506
+ null
5507
+ );
5541
5508
  case 3:
5542
- pushHostRootContext(workInProgress);
5543
- break;
5509
+ return (
5510
+ (renderLanes = workInProgress.stateNode),
5511
+ popHostContainer(),
5512
+ pop(didPerformWorkStackCursor),
5513
+ pop(contextStackCursor),
5514
+ resetWorkInProgressVersions(),
5515
+ renderLanes.pendingContext &&
5516
+ ((renderLanes.context = renderLanes.pendingContext),
5517
+ (renderLanes.pendingContext = null)),
5518
+ (null !== current && null !== current.child) ||
5519
+ null === current ||
5520
+ (current.memoizedState.isDehydrated &&
5521
+ 0 === (workInProgress.flags & 256)) ||
5522
+ ((workInProgress.flags |= 1024),
5523
+ null !== hydrationErrors &&
5524
+ (queueRecoverableErrors(hydrationErrors),
5525
+ (hydrationErrors = null))),
5526
+ updateHostContainer(current, workInProgress),
5527
+ bubbleProperties(workInProgress),
5528
+ null
5529
+ );
5544
5530
  case 5:
5545
- pushHostContext(workInProgress);
5546
- break;
5547
- case 1:
5548
- isContextProvider(workInProgress.type) &&
5549
- pushContextProvider(workInProgress);
5550
- break;
5551
- case 4:
5552
- pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo);
5553
- break;
5554
- case 10:
5555
- var context = workInProgress.type._context,
5556
- nextValue = workInProgress.memoizedProps.value;
5557
- push(valueCursor, context._currentValue2);
5558
- context._currentValue2 = nextValue;
5559
- break;
5560
- case 13:
5561
- if (null !== workInProgress.memoizedState) {
5562
- if (0 !== (renderLanes & workInProgress.child.childLanes))
5563
- return updateSuspenseComponent(current, workInProgress, renderLanes);
5564
- push(suspenseStackCursor, suspenseStackCursor.current & 1);
5565
- current = bailoutOnAlreadyFinishedWork(
5531
+ popHostContext(workInProgress);
5532
+ renderLanes = requiredContext(rootInstanceStackCursor.current);
5533
+ var type = workInProgress.type;
5534
+ if (null !== current && null != workInProgress.stateNode)
5535
+ updateHostComponent$1(
5566
5536
  current,
5567
5537
  workInProgress,
5538
+ type,
5539
+ newProps,
5568
5540
  renderLanes
5541
+ ),
5542
+ current.ref !== workInProgress.ref && (workInProgress.flags |= 512);
5543
+ else {
5544
+ if (!newProps) {
5545
+ if (null === workInProgress.stateNode)
5546
+ throw Error(
5547
+ "We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue."
5548
+ );
5549
+ bubbleProperties(workInProgress);
5550
+ return null;
5551
+ }
5552
+ requiredContext(contextStackCursor$1.current);
5553
+ current = nextReactTag;
5554
+ nextReactTag += 2;
5555
+ type = getViewConfigForType(type);
5556
+ var updatePayload = diffProperties(
5557
+ null,
5558
+ emptyObject,
5559
+ newProps,
5560
+ type.validAttributes
5569
5561
  );
5570
- return null !== current ? current.sibling : null;
5562
+ renderLanes = createNode(
5563
+ current,
5564
+ type.uiViewClassName,
5565
+ renderLanes,
5566
+ updatePayload,
5567
+ workInProgress
5568
+ );
5569
+ current = new ReactFabricHostComponent(
5570
+ current,
5571
+ type,
5572
+ newProps,
5573
+ workInProgress
5574
+ );
5575
+ current = { node: renderLanes, canonical: current };
5576
+ appendAllChildren(current, workInProgress, !1, !1);
5577
+ workInProgress.stateNode = current;
5578
+ null !== workInProgress.ref && (workInProgress.flags |= 512);
5571
5579
  }
5572
- push(suspenseStackCursor, suspenseStackCursor.current & 1);
5573
- break;
5574
- case 19:
5575
- context = 0 !== (renderLanes & workInProgress.childLanes);
5576
- if (0 !== (current.flags & 128)) {
5577
- if (context)
5578
- return updateSuspenseListComponent(
5579
- current,
5580
- workInProgress,
5581
- renderLanes
5580
+ bubbleProperties(workInProgress);
5581
+ return null;
5582
+ case 6:
5583
+ if (current && null != workInProgress.stateNode)
5584
+ updateHostText$1(
5585
+ current,
5586
+ workInProgress,
5587
+ current.memoizedProps,
5588
+ newProps
5589
+ );
5590
+ else {
5591
+ if ("string" !== typeof newProps && null === workInProgress.stateNode)
5592
+ throw Error(
5593
+ "We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue."
5582
5594
  );
5583
- workInProgress.flags |= 128;
5595
+ current = requiredContext(rootInstanceStackCursor.current);
5596
+ renderLanes = requiredContext(contextStackCursor$1.current);
5597
+ workInProgress.stateNode = createTextInstance(
5598
+ newProps,
5599
+ current,
5600
+ renderLanes,
5601
+ workInProgress
5602
+ );
5603
+ }
5604
+ bubbleProperties(workInProgress);
5605
+ return null;
5606
+ case 13:
5607
+ pop(suspenseStackCursor);
5608
+ newProps = workInProgress.memoizedState;
5609
+ if (
5610
+ null === current ||
5611
+ (null !== current.memoizedState &&
5612
+ null !== current.memoizedState.dehydrated)
5613
+ ) {
5614
+ if (null !== newProps && null !== newProps.dehydrated) {
5615
+ if (null === current) {
5616
+ throw Error(
5617
+ "A dehydrated suspense component was completed without a hydrated node. This is probably a bug in React."
5618
+ );
5619
+ throw Error(
5620
+ "Expected prepareToHydrateHostSuspenseInstance() to never be called. This error is likely caused by a bug in React. Please file an issue."
5621
+ );
5622
+ }
5623
+ 0 === (workInProgress.flags & 128) &&
5624
+ (workInProgress.memoizedState = null);
5625
+ workInProgress.flags |= 4;
5626
+ bubbleProperties(workInProgress);
5627
+ type = !1;
5628
+ } else
5629
+ null !== hydrationErrors &&
5630
+ (queueRecoverableErrors(hydrationErrors), (hydrationErrors = null)),
5631
+ (type = !0);
5632
+ if (!type) return workInProgress.flags & 65536 ? workInProgress : null;
5633
+ }
5634
+ if (0 !== (workInProgress.flags & 128))
5635
+ return (workInProgress.lanes = renderLanes), workInProgress;
5636
+ renderLanes = null !== newProps;
5637
+ renderLanes !== (null !== current && null !== current.memoizedState) &&
5638
+ renderLanes &&
5639
+ ((workInProgress.child.flags |= 8192),
5640
+ 0 !== (workInProgress.mode & 1) &&
5641
+ (null === current || 0 !== (suspenseStackCursor.current & 1)
5642
+ ? 0 === workInProgressRootExitStatus &&
5643
+ (workInProgressRootExitStatus = 3)
5644
+ : renderDidSuspendDelayIfPossible()));
5645
+ null !== workInProgress.updateQueue && (workInProgress.flags |= 4);
5646
+ bubbleProperties(workInProgress);
5647
+ return null;
5648
+ case 4:
5649
+ return (
5650
+ popHostContainer(),
5651
+ updateHostContainer(current, workInProgress),
5652
+ bubbleProperties(workInProgress),
5653
+ null
5654
+ );
5655
+ case 10:
5656
+ return (
5657
+ popProvider(workInProgress.type._context),
5658
+ bubbleProperties(workInProgress),
5659
+ null
5660
+ );
5661
+ case 17:
5662
+ return (
5663
+ isContextProvider(workInProgress.type) && popContext(),
5664
+ bubbleProperties(workInProgress),
5665
+ null
5666
+ );
5667
+ case 19:
5668
+ pop(suspenseStackCursor);
5669
+ type = workInProgress.memoizedState;
5670
+ if (null === type) return bubbleProperties(workInProgress), null;
5671
+ newProps = 0 !== (workInProgress.flags & 128);
5672
+ updatePayload = type.rendering;
5673
+ if (null === updatePayload)
5674
+ if (newProps) cutOffTailIfNeeded(type, !1);
5675
+ else {
5676
+ if (
5677
+ 0 !== workInProgressRootExitStatus ||
5678
+ (null !== current && 0 !== (current.flags & 128))
5679
+ )
5680
+ for (current = workInProgress.child; null !== current; ) {
5681
+ updatePayload = findFirstSuspended(current);
5682
+ if (null !== updatePayload) {
5683
+ workInProgress.flags |= 128;
5684
+ cutOffTailIfNeeded(type, !1);
5685
+ current = updatePayload.updateQueue;
5686
+ null !== current &&
5687
+ ((workInProgress.updateQueue = current),
5688
+ (workInProgress.flags |= 4));
5689
+ workInProgress.subtreeFlags = 0;
5690
+ current = renderLanes;
5691
+ for (renderLanes = workInProgress.child; null !== renderLanes; )
5692
+ (newProps = renderLanes),
5693
+ (type = current),
5694
+ (newProps.flags &= 14680066),
5695
+ (updatePayload = newProps.alternate),
5696
+ null === updatePayload
5697
+ ? ((newProps.childLanes = 0),
5698
+ (newProps.lanes = type),
5699
+ (newProps.child = null),
5700
+ (newProps.subtreeFlags = 0),
5701
+ (newProps.memoizedProps = null),
5702
+ (newProps.memoizedState = null),
5703
+ (newProps.updateQueue = null),
5704
+ (newProps.dependencies = null),
5705
+ (newProps.stateNode = null))
5706
+ : ((newProps.childLanes = updatePayload.childLanes),
5707
+ (newProps.lanes = updatePayload.lanes),
5708
+ (newProps.child = updatePayload.child),
5709
+ (newProps.subtreeFlags = 0),
5710
+ (newProps.deletions = null),
5711
+ (newProps.memoizedProps = updatePayload.memoizedProps),
5712
+ (newProps.memoizedState = updatePayload.memoizedState),
5713
+ (newProps.updateQueue = updatePayload.updateQueue),
5714
+ (newProps.type = updatePayload.type),
5715
+ (type = updatePayload.dependencies),
5716
+ (newProps.dependencies =
5717
+ null === type
5718
+ ? null
5719
+ : {
5720
+ lanes: type.lanes,
5721
+ firstContext: type.firstContext
5722
+ })),
5723
+ (renderLanes = renderLanes.sibling);
5724
+ push(
5725
+ suspenseStackCursor,
5726
+ (suspenseStackCursor.current & 1) | 2
5727
+ );
5728
+ return workInProgress.child;
5729
+ }
5730
+ current = current.sibling;
5731
+ }
5732
+ null !== type.tail &&
5733
+ now() > workInProgressRootRenderTargetTime &&
5734
+ ((workInProgress.flags |= 128),
5735
+ (newProps = !0),
5736
+ cutOffTailIfNeeded(type, !1),
5737
+ (workInProgress.lanes = 4194304));
5738
+ }
5739
+ else {
5740
+ if (!newProps)
5741
+ if (
5742
+ ((current = findFirstSuspended(updatePayload)), null !== current)
5743
+ ) {
5744
+ if (
5745
+ ((workInProgress.flags |= 128),
5746
+ (newProps = !0),
5747
+ (current = current.updateQueue),
5748
+ null !== current &&
5749
+ ((workInProgress.updateQueue = current),
5750
+ (workInProgress.flags |= 4)),
5751
+ cutOffTailIfNeeded(type, !0),
5752
+ null === type.tail &&
5753
+ "hidden" === type.tailMode &&
5754
+ !updatePayload.alternate)
5755
+ )
5756
+ return bubbleProperties(workInProgress), null;
5757
+ } else
5758
+ 2 * now() - type.renderingStartTime >
5759
+ workInProgressRootRenderTargetTime &&
5760
+ 1073741824 !== renderLanes &&
5761
+ ((workInProgress.flags |= 128),
5762
+ (newProps = !0),
5763
+ cutOffTailIfNeeded(type, !1),
5764
+ (workInProgress.lanes = 4194304));
5765
+ type.isBackwards
5766
+ ? ((updatePayload.sibling = workInProgress.child),
5767
+ (workInProgress.child = updatePayload))
5768
+ : ((current = type.last),
5769
+ null !== current
5770
+ ? (current.sibling = updatePayload)
5771
+ : (workInProgress.child = updatePayload),
5772
+ (type.last = updatePayload));
5584
5773
  }
5585
- nextValue = workInProgress.memoizedState;
5586
- null !== nextValue &&
5587
- ((nextValue.rendering = null),
5588
- (nextValue.tail = null),
5589
- (nextValue.lastEffect = null));
5590
- push(suspenseStackCursor, suspenseStackCursor.current);
5591
- if (context) break;
5592
- else return null;
5774
+ if (null !== type.tail)
5775
+ return (
5776
+ (workInProgress = type.tail),
5777
+ (type.rendering = workInProgress),
5778
+ (type.tail = workInProgress.sibling),
5779
+ (type.renderingStartTime = now()),
5780
+ (workInProgress.sibling = null),
5781
+ (current = suspenseStackCursor.current),
5782
+ push(suspenseStackCursor, newProps ? (current & 1) | 2 : current & 1),
5783
+ workInProgress
5784
+ );
5785
+ bubbleProperties(workInProgress);
5786
+ return null;
5593
5787
  case 22:
5594
5788
  case 23:
5595
5789
  return (
5596
- (workInProgress.lanes = 0),
5597
- updateOffscreenComponent(current, workInProgress, renderLanes)
5790
+ popRenderLanes(),
5791
+ (renderLanes = null !== workInProgress.memoizedState),
5792
+ null !== current &&
5793
+ (null !== current.memoizedState) !== renderLanes &&
5794
+ (workInProgress.flags |= 8192),
5795
+ renderLanes && 0 !== (workInProgress.mode & 1)
5796
+ ? 0 !== (subtreeRenderLanes & 1073741824) &&
5797
+ bubbleProperties(workInProgress)
5798
+ : bubbleProperties(workInProgress),
5799
+ null
5598
5800
  );
5801
+ case 24:
5802
+ return null;
5803
+ case 25:
5804
+ return null;
5599
5805
  }
5600
- return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes);
5806
+ throw Error(
5807
+ "Unknown unit of work tag (" +
5808
+ workInProgress.tag +
5809
+ "). This error is likely caused by a bug in React. Please file an issue."
5810
+ );
5601
5811
  }
5602
5812
  function unwindWork(current, workInProgress) {
5603
5813
  popTreeContext(workInProgress);
@@ -5624,13 +5834,20 @@ function unwindWork(current, workInProgress) {
5624
5834
  case 5:
5625
5835
  return popHostContext(workInProgress), null;
5626
5836
  case 13:
5627
- return (
5628
- pop(suspenseStackCursor),
5629
- (current = workInProgress.flags),
5630
- current & 65536
5631
- ? ((workInProgress.flags = (current & -65537) | 128), workInProgress)
5632
- : null
5633
- );
5837
+ pop(suspenseStackCursor);
5838
+ current = workInProgress.memoizedState;
5839
+ if (
5840
+ null !== current &&
5841
+ null !== current.dehydrated &&
5842
+ null === workInProgress.alternate
5843
+ )
5844
+ throw Error(
5845
+ "Threw in newly mounted dehydrated component. This is likely a bug in React. Please file an issue."
5846
+ );
5847
+ current = workInProgress.flags;
5848
+ return current & 65536
5849
+ ? ((workInProgress.flags = (current & -65537) | 128), workInProgress)
5850
+ : null;
5634
5851
  case 19:
5635
5852
  return pop(suspenseStackCursor), null;
5636
5853
  case 4:
@@ -5754,8 +5971,8 @@ function commitHookEffectListMount(flags, finishedWork) {
5754
5971
  var effect = (finishedWork = finishedWork.next);
5755
5972
  do {
5756
5973
  if ((effect.tag & flags) === flags) {
5757
- var create$77 = effect.create;
5758
- effect.destroy = create$77();
5974
+ var create$73 = effect.create;
5975
+ effect.destroy = create$73();
5759
5976
  }
5760
5977
  effect = effect.next;
5761
5978
  } while (effect !== finishedWork);
@@ -5777,41 +5994,113 @@ function detachFiberAfterEffects(fiber) {
5777
5994
  fiber.stateNode = null;
5778
5995
  fiber.updateQueue = null;
5779
5996
  }
5780
- function commitWork(current, finishedWork) {
5781
- switch (finishedWork.tag) {
5997
+ function recursivelyTraverseDeletionEffects(
5998
+ finishedRoot,
5999
+ nearestMountedAncestor,
6000
+ parent
6001
+ ) {
6002
+ for (parent = parent.child; null !== parent; )
6003
+ commitDeletionEffectsOnFiber(finishedRoot, nearestMountedAncestor, parent),
6004
+ (parent = parent.sibling);
6005
+ }
6006
+ function commitDeletionEffectsOnFiber(
6007
+ finishedRoot,
6008
+ nearestMountedAncestor,
6009
+ deletedFiber
6010
+ ) {
6011
+ if (injectedHook && "function" === typeof injectedHook.onCommitFiberUnmount)
6012
+ try {
6013
+ injectedHook.onCommitFiberUnmount(rendererID, deletedFiber);
6014
+ } catch (err) {}
6015
+ switch (deletedFiber.tag) {
6016
+ case 5:
6017
+ safelyDetachRef(deletedFiber, nearestMountedAncestor);
6018
+ case 6:
6019
+ recursivelyTraverseDeletionEffects(
6020
+ finishedRoot,
6021
+ nearestMountedAncestor,
6022
+ deletedFiber
6023
+ );
6024
+ break;
6025
+ case 18:
6026
+ break;
6027
+ case 4:
6028
+ createChildNodeSet(deletedFiber.stateNode.containerInfo);
6029
+ recursivelyTraverseDeletionEffects(
6030
+ finishedRoot,
6031
+ nearestMountedAncestor,
6032
+ deletedFiber
6033
+ );
6034
+ break;
5782
6035
  case 0:
5783
6036
  case 11:
5784
6037
  case 14:
5785
6038
  case 15:
5786
- commitHookEffectListUnmount(3, finishedWork, finishedWork.return);
5787
- commitHookEffectListMount(3, finishedWork);
5788
- commitHookEffectListUnmount(5, finishedWork, finishedWork.return);
5789
- return;
5790
- case 12:
5791
- return;
5792
- case 13:
5793
- attachSuspenseRetryListeners(finishedWork);
5794
- return;
5795
- case 19:
5796
- attachSuspenseRetryListeners(finishedWork);
5797
- return;
6039
+ var updateQueue = deletedFiber.updateQueue;
6040
+ if (
6041
+ null !== updateQueue &&
6042
+ ((updateQueue = updateQueue.lastEffect), null !== updateQueue)
6043
+ ) {
6044
+ var effect = (updateQueue = updateQueue.next);
6045
+ do {
6046
+ var _effect = effect,
6047
+ destroy = _effect.destroy;
6048
+ _effect = _effect.tag;
6049
+ void 0 !== destroy &&
6050
+ (0 !== (_effect & 2)
6051
+ ? safelyCallDestroy(deletedFiber, nearestMountedAncestor, destroy)
6052
+ : 0 !== (_effect & 4) &&
6053
+ safelyCallDestroy(
6054
+ deletedFiber,
6055
+ nearestMountedAncestor,
6056
+ destroy
6057
+ ));
6058
+ effect = effect.next;
6059
+ } while (effect !== updateQueue);
6060
+ }
6061
+ recursivelyTraverseDeletionEffects(
6062
+ finishedRoot,
6063
+ nearestMountedAncestor,
6064
+ deletedFiber
6065
+ );
6066
+ break;
6067
+ case 1:
6068
+ safelyDetachRef(deletedFiber, nearestMountedAncestor);
6069
+ updateQueue = deletedFiber.stateNode;
6070
+ if ("function" === typeof updateQueue.componentWillUnmount)
6071
+ try {
6072
+ (updateQueue.props = deletedFiber.memoizedProps),
6073
+ (updateQueue.state = deletedFiber.memoizedState),
6074
+ updateQueue.componentWillUnmount();
6075
+ } catch (error) {
6076
+ captureCommitPhaseError(deletedFiber, nearestMountedAncestor, error);
6077
+ }
6078
+ recursivelyTraverseDeletionEffects(
6079
+ finishedRoot,
6080
+ nearestMountedAncestor,
6081
+ deletedFiber
6082
+ );
6083
+ break;
6084
+ case 21:
6085
+ recursivelyTraverseDeletionEffects(
6086
+ finishedRoot,
6087
+ nearestMountedAncestor,
6088
+ deletedFiber
6089
+ );
6090
+ break;
5798
6091
  case 22:
5799
- case 23:
5800
- return;
5801
- }
5802
- a: {
5803
- switch (finishedWork.tag) {
5804
- case 1:
5805
- case 5:
5806
- case 6:
5807
- break a;
5808
- case 3:
5809
- case 4:
5810
- break a;
5811
- }
5812
- throw Error(
5813
- "This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue."
5814
- );
6092
+ recursivelyTraverseDeletionEffects(
6093
+ finishedRoot,
6094
+ nearestMountedAncestor,
6095
+ deletedFiber
6096
+ );
6097
+ break;
6098
+ default:
6099
+ recursivelyTraverseDeletionEffects(
6100
+ finishedRoot,
6101
+ nearestMountedAncestor,
6102
+ deletedFiber
6103
+ );
5815
6104
  }
5816
6105
  }
5817
6106
  function attachSuspenseRetryListeners(finishedWork) {
@@ -5828,146 +6117,106 @@ function attachSuspenseRetryListeners(finishedWork) {
5828
6117
  });
5829
6118
  }
5830
6119
  }
5831
- function commitMutationEffects(root, firstChild) {
5832
- for (nextEffect = firstChild; null !== nextEffect; ) {
5833
- root = nextEffect;
5834
- firstChild = root.deletions;
5835
- if (null !== firstChild)
5836
- for (var i = 0; i < firstChild.length; i++) {
5837
- var childToDelete = firstChild[i];
5838
- try {
5839
- a: for (var node = childToDelete; ; ) {
5840
- var current = node;
5841
- if (
5842
- injectedHook &&
5843
- "function" === typeof injectedHook.onCommitFiberUnmount
5844
- )
5845
- try {
5846
- injectedHook.onCommitFiberUnmount(rendererID, current);
5847
- } catch (err) {}
5848
- switch (current.tag) {
5849
- case 0:
5850
- case 11:
5851
- case 14:
5852
- case 15:
5853
- var updateQueue = current.updateQueue;
5854
- if (null !== updateQueue) {
5855
- var lastEffect = updateQueue.lastEffect;
5856
- if (null !== lastEffect) {
5857
- var firstEffect = lastEffect.next,
5858
- effect = firstEffect;
5859
- do {
5860
- var _effect = effect,
5861
- destroy = _effect.destroy,
5862
- tag = _effect.tag;
5863
- void 0 !== destroy &&
5864
- (0 !== (tag & 2)
5865
- ? safelyCallDestroy(current, root, destroy)
5866
- : 0 !== (tag & 4) &&
5867
- safelyCallDestroy(current, root, destroy));
5868
- effect = effect.next;
5869
- } while (effect !== firstEffect);
5870
- }
5871
- }
5872
- break;
5873
- case 1:
5874
- safelyDetachRef(current, root);
5875
- var instance = current.stateNode;
5876
- if ("function" === typeof instance.componentWillUnmount)
5877
- try {
5878
- (effect = current),
5879
- (_effect = instance),
5880
- (_effect.props = effect.memoizedProps),
5881
- (_effect.state = effect.memoizedState),
5882
- _effect.componentWillUnmount();
5883
- } catch (error) {
5884
- captureCommitPhaseError(current, root, error);
5885
- }
5886
- break;
5887
- case 5:
5888
- safelyDetachRef(current, root);
5889
- break;
5890
- case 4:
5891
- createChildNodeSet(current.stateNode.containerInfo);
5892
- }
5893
- if (null !== node.child)
5894
- (node.child.return = node), (node = node.child);
5895
- else {
5896
- if (node === childToDelete) break;
5897
- for (; null === node.sibling; ) {
5898
- if (null === node.return || node.return === childToDelete)
5899
- break a;
5900
- node = node.return;
5901
- }
5902
- node.sibling.return = node.return;
5903
- node = node.sibling;
5904
- }
5905
- }
5906
- var alternate = childToDelete.alternate;
5907
- null !== alternate && (alternate.return = null);
5908
- childToDelete.return = null;
5909
- } catch (error) {
5910
- captureCommitPhaseError(childToDelete, root, error);
5911
- }
6120
+ function recursivelyTraverseMutationEffects(root, parentFiber) {
6121
+ var deletions = parentFiber.deletions;
6122
+ if (null !== deletions)
6123
+ for (var i = 0; i < deletions.length; i++) {
6124
+ var childToDelete = deletions[i];
6125
+ try {
6126
+ commitDeletionEffectsOnFiber(root, parentFiber, childToDelete);
6127
+ var alternate = childToDelete.alternate;
6128
+ null !== alternate && (alternate.return = null);
6129
+ childToDelete.return = null;
6130
+ } catch (error) {
6131
+ captureCommitPhaseError(childToDelete, parentFiber, error);
5912
6132
  }
5913
- firstChild = root.child;
5914
- if (0 !== (root.subtreeFlags & 12854) && null !== firstChild)
5915
- (firstChild.return = root), (nextEffect = firstChild);
5916
- else
5917
- for (; null !== nextEffect; ) {
5918
- root = nextEffect;
6133
+ }
6134
+ if (parentFiber.subtreeFlags & 12854)
6135
+ for (parentFiber = parentFiber.child; null !== parentFiber; )
6136
+ commitMutationEffectsOnFiber(parentFiber, root),
6137
+ (parentFiber = parentFiber.sibling);
6138
+ }
6139
+ function commitMutationEffectsOnFiber(finishedWork, root) {
6140
+ var current = finishedWork.alternate,
6141
+ flags = finishedWork.flags;
6142
+ switch (finishedWork.tag) {
6143
+ case 0:
6144
+ case 11:
6145
+ case 14:
6146
+ case 15:
6147
+ recursivelyTraverseMutationEffects(root, finishedWork);
6148
+ commitReconciliationEffects(finishedWork);
6149
+ if (flags & 4) {
5919
6150
  try {
5920
- var flags = root.flags;
5921
- if (flags & 512) {
5922
- var current$jscomp$0 = root.alternate;
5923
- if (null !== current$jscomp$0) {
5924
- var currentRef = current$jscomp$0.ref;
5925
- null !== currentRef &&
5926
- ("function" === typeof currentRef
5927
- ? currentRef(null)
5928
- : (currentRef.current = null));
5929
- }
5930
- }
5931
- if (flags & 8192)
5932
- switch (root.tag) {
5933
- case 13:
5934
- if (null !== root.memoizedState) {
5935
- var current$81 = root.alternate;
5936
- if (null === current$81 || null === current$81.memoizedState)
5937
- globalMostRecentFallbackTime = now();
5938
- }
5939
- }
5940
- switch (flags & 4102) {
5941
- case 2:
5942
- root.flags &= -3;
5943
- break;
5944
- case 6:
5945
- root.flags &= -3;
5946
- commitWork(root.alternate, root);
5947
- break;
5948
- case 4096:
5949
- root.flags &= -4097;
5950
- break;
5951
- case 4100:
5952
- root.flags &= -4097;
5953
- commitWork(root.alternate, root);
5954
- break;
5955
- case 4:
5956
- commitWork(root.alternate, root);
5957
- }
6151
+ commitHookEffectListUnmount(3, finishedWork, finishedWork.return),
6152
+ commitHookEffectListMount(3, finishedWork);
5958
6153
  } catch (error) {
5959
- captureCommitPhaseError(root, root.return, error);
6154
+ captureCommitPhaseError(finishedWork, finishedWork.return, error);
5960
6155
  }
5961
- firstChild = root.sibling;
5962
- if (null !== firstChild) {
5963
- firstChild.return = root.return;
5964
- nextEffect = firstChild;
5965
- break;
6156
+ try {
6157
+ commitHookEffectListUnmount(5, finishedWork, finishedWork.return);
6158
+ } catch (error$77) {
6159
+ captureCommitPhaseError(finishedWork, finishedWork.return, error$77);
5966
6160
  }
5967
- nextEffect = root.return;
5968
6161
  }
6162
+ break;
6163
+ case 1:
6164
+ recursivelyTraverseMutationEffects(root, finishedWork);
6165
+ commitReconciliationEffects(finishedWork);
6166
+ flags & 512 &&
6167
+ null !== current &&
6168
+ safelyDetachRef(current, current.return);
6169
+ break;
6170
+ case 5:
6171
+ recursivelyTraverseMutationEffects(root, finishedWork);
6172
+ commitReconciliationEffects(finishedWork);
6173
+ flags & 512 &&
6174
+ null !== current &&
6175
+ safelyDetachRef(current, current.return);
6176
+ break;
6177
+ case 6:
6178
+ recursivelyTraverseMutationEffects(root, finishedWork);
6179
+ commitReconciliationEffects(finishedWork);
6180
+ break;
6181
+ case 3:
6182
+ recursivelyTraverseMutationEffects(root, finishedWork);
6183
+ commitReconciliationEffects(finishedWork);
6184
+ break;
6185
+ case 4:
6186
+ recursivelyTraverseMutationEffects(root, finishedWork);
6187
+ commitReconciliationEffects(finishedWork);
6188
+ break;
6189
+ case 13:
6190
+ recursivelyTraverseMutationEffects(root, finishedWork);
6191
+ commitReconciliationEffects(finishedWork);
6192
+ root = finishedWork.child;
6193
+ root.flags & 8192 &&
6194
+ null !== root.memoizedState &&
6195
+ (null === root.alternate || null === root.alternate.memoizedState) &&
6196
+ (globalMostRecentFallbackTime = now());
6197
+ flags & 4 && attachSuspenseRetryListeners(finishedWork);
6198
+ break;
6199
+ case 22:
6200
+ recursivelyTraverseMutationEffects(root, finishedWork);
6201
+ commitReconciliationEffects(finishedWork);
6202
+ break;
6203
+ case 19:
6204
+ recursivelyTraverseMutationEffects(root, finishedWork);
6205
+ commitReconciliationEffects(finishedWork);
6206
+ flags & 4 && attachSuspenseRetryListeners(finishedWork);
6207
+ break;
6208
+ case 21:
6209
+ break;
6210
+ default:
6211
+ recursivelyTraverseMutationEffects(root, finishedWork),
6212
+ commitReconciliationEffects(finishedWork);
5969
6213
  }
5970
6214
  }
6215
+ function commitReconciliationEffects(finishedWork) {
6216
+ var flags = finishedWork.flags;
6217
+ flags & 2 && (finishedWork.flags &= -3);
6218
+ flags & 4096 && (finishedWork.flags &= -4097);
6219
+ }
5971
6220
  function commitLayoutEffects(finishedWork) {
5972
6221
  for (nextEffect = finishedWork; null !== nextEffect; ) {
5973
6222
  var fiber = nextEffect,
@@ -6010,8 +6259,8 @@ function commitLayoutEffects(finishedWork) {
6010
6259
  commitUpdateQueue(firstChild, updateQueue, instance);
6011
6260
  break;
6012
6261
  case 3:
6013
- var updateQueue$78 = firstChild.updateQueue;
6014
- if (null !== updateQueue$78) {
6262
+ var updateQueue$74 = firstChild.updateQueue;
6263
+ if (null !== updateQueue$74) {
6015
6264
  current = null;
6016
6265
  if (null !== firstChild.child)
6017
6266
  switch (firstChild.child.tag) {
@@ -6021,7 +6270,7 @@ function commitLayoutEffects(finishedWork) {
6021
6270
  case 1:
6022
6271
  current = firstChild.child.stateNode;
6023
6272
  }
6024
- commitUpdateQueue(firstChild, updateQueue$78, current);
6273
+ commitUpdateQueue(firstChild, updateQueue$74, current);
6025
6274
  }
6026
6275
  break;
6027
6276
  case 5:
@@ -6043,6 +6292,7 @@ function commitLayoutEffects(finishedWork) {
6043
6292
  case 21:
6044
6293
  case 22:
6045
6294
  case 23:
6295
+ case 25:
6046
6296
  break;
6047
6297
  default:
6048
6298
  throw Error(
@@ -6103,6 +6353,7 @@ var ceil = Math.ceil,
6103
6353
  workInProgressRootRecoverableErrors = null,
6104
6354
  globalMostRecentFallbackTime = 0,
6105
6355
  workInProgressRootRenderTargetTime = Infinity,
6356
+ workInProgressTransitions = null,
6106
6357
  hasUncaughtError = !1,
6107
6358
  firstUncaughtError = null,
6108
6359
  legacyErrorBoundariesThatAlreadyFailed = null,
@@ -6127,10 +6378,7 @@ function requestUpdateLane(fiber) {
6127
6378
  if (null !== ReactCurrentBatchConfig.transition)
6128
6379
  return (
6129
6380
  0 === currentEventTransitionLane &&
6130
- ((fiber = nextTransitionLane),
6131
- (nextTransitionLane <<= 1),
6132
- 0 === (nextTransitionLane & 4194240) && (nextTransitionLane = 64),
6133
- (currentEventTransitionLane = fiber)),
6381
+ (currentEventTransitionLane = claimNextTransitionLane()),
6134
6382
  currentEventTransitionLane
6135
6383
  );
6136
6384
  fiber = currentUpdatePriority;
@@ -6186,6 +6434,13 @@ function markUpdateLaneFromFiberToRoot(sourceFiber, lane) {
6186
6434
  (sourceFiber = sourceFiber.return);
6187
6435
  return 3 === alternate.tag ? alternate.stateNode : null;
6188
6436
  }
6437
+ function isInterleavedUpdate(fiber) {
6438
+ return (
6439
+ (null !== workInProgressRoot || null !== interleavedQueues) &&
6440
+ 0 !== (fiber.mode & 1) &&
6441
+ 0 === (executionContext & 2)
6442
+ );
6443
+ }
6189
6444
  function ensureRootIsScheduled(root, currentTime) {
6190
6445
  for (
6191
6446
  var existingCallbackNode = root.callbackNode,
@@ -6281,7 +6536,8 @@ function performConcurrentWorkOnRoot(root, didTimeout) {
6281
6536
  workInProgressRoot !== root ||
6282
6537
  workInProgressRootRenderLanes !== didTimeout
6283
6538
  )
6284
- (workInProgressRootRenderTargetTime = now() + 500),
6539
+ (workInProgressTransitions = null),
6540
+ (workInProgressRootRenderTargetTime = now() + 500),
6285
6541
  prepareFreshStack(root, didTimeout);
6286
6542
  do
6287
6543
  try {
@@ -6338,7 +6594,11 @@ function performConcurrentWorkOnRoot(root, didTimeout) {
6338
6594
  case 1:
6339
6595
  throw Error("Root did not complete. This is a bug in React.");
6340
6596
  case 2:
6341
- commitRoot(root, workInProgressRootRecoverableErrors);
6597
+ commitRoot(
6598
+ root,
6599
+ workInProgressRootRecoverableErrors,
6600
+ workInProgressTransitions
6601
+ );
6342
6602
  break;
6343
6603
  case 3:
6344
6604
  markRootSuspended$1(root, lanes);
@@ -6355,12 +6615,21 @@ function performConcurrentWorkOnRoot(root, didTimeout) {
6355
6615
  break;
6356
6616
  }
6357
6617
  root.timeoutHandle = scheduleTimeout(
6358
- commitRoot.bind(null, root, workInProgressRootRecoverableErrors),
6618
+ commitRoot.bind(
6619
+ null,
6620
+ root,
6621
+ workInProgressRootRecoverableErrors,
6622
+ workInProgressTransitions
6623
+ ),
6359
6624
  didTimeout
6360
6625
  );
6361
6626
  break;
6362
6627
  }
6363
- commitRoot(root, workInProgressRootRecoverableErrors);
6628
+ commitRoot(
6629
+ root,
6630
+ workInProgressRootRecoverableErrors,
6631
+ workInProgressTransitions
6632
+ );
6364
6633
  break;
6365
6634
  case 4:
6366
6635
  markRootSuspended$1(root, lanes);
@@ -6391,15 +6660,28 @@ function performConcurrentWorkOnRoot(root, didTimeout) {
6391
6660
  : 1960 * ceil(lanes / 1960)) - lanes;
6392
6661
  if (10 < lanes) {
6393
6662
  root.timeoutHandle = scheduleTimeout(
6394
- commitRoot.bind(null, root, workInProgressRootRecoverableErrors),
6663
+ commitRoot.bind(
6664
+ null,
6665
+ root,
6666
+ workInProgressRootRecoverableErrors,
6667
+ workInProgressTransitions
6668
+ ),
6395
6669
  lanes
6396
6670
  );
6397
6671
  break;
6398
6672
  }
6399
- commitRoot(root, workInProgressRootRecoverableErrors);
6673
+ commitRoot(
6674
+ root,
6675
+ workInProgressRootRecoverableErrors,
6676
+ workInProgressTransitions
6677
+ );
6400
6678
  break;
6401
6679
  case 5:
6402
- commitRoot(root, workInProgressRootRecoverableErrors);
6680
+ commitRoot(
6681
+ root,
6682
+ workInProgressRootRecoverableErrors,
6683
+ workInProgressTransitions
6684
+ );
6403
6685
  break;
6404
6686
  default:
6405
6687
  throw Error("Unknown root exit status.");
@@ -6419,15 +6701,17 @@ function recoverFromConcurrentError(root, errorRetryLanes) {
6419
6701
  2 !== root &&
6420
6702
  ((errorRetryLanes = workInProgressRootRecoverableErrors),
6421
6703
  (workInProgressRootRecoverableErrors = errorsFromFirstAttempt),
6422
- null !== errorRetryLanes &&
6423
- (null === workInProgressRootRecoverableErrors
6424
- ? (workInProgressRootRecoverableErrors = errorRetryLanes)
6425
- : workInProgressRootRecoverableErrors.push.apply(
6426
- workInProgressRootRecoverableErrors,
6427
- errorRetryLanes
6428
- )));
6704
+ null !== errorRetryLanes && queueRecoverableErrors(errorRetryLanes));
6429
6705
  return root;
6430
6706
  }
6707
+ function queueRecoverableErrors(errors) {
6708
+ null === workInProgressRootRecoverableErrors
6709
+ ? (workInProgressRootRecoverableErrors = errors)
6710
+ : workInProgressRootRecoverableErrors.push.apply(
6711
+ workInProgressRootRecoverableErrors,
6712
+ errors
6713
+ );
6714
+ }
6431
6715
  function isRenderConsistentWithExternalStores(finishedWork) {
6432
6716
  for (var node = finishedWork; ; ) {
6433
6717
  if (node.flags & 16384) {
@@ -6497,7 +6781,11 @@ function performSyncWorkOnRoot(root) {
6497
6781
  throw Error("Root did not complete. This is a bug in React.");
6498
6782
  root.finishedWork = root.current.alternate;
6499
6783
  root.finishedLanes = lanes;
6500
- commitRoot(root, workInProgressRootRecoverableErrors);
6784
+ commitRoot(
6785
+ root,
6786
+ workInProgressRootRecoverableErrors,
6787
+ workInProgressTransitions
6788
+ );
6501
6789
  ensureRootIsScheduled(root, now());
6502
6790
  return null;
6503
6791
  }
@@ -6733,12 +7021,12 @@ function handleError(root$jscomp$0, thrownValue) {
6733
7021
  root.flags |= 65536;
6734
7022
  thrownValue &= -thrownValue;
6735
7023
  root.lanes |= thrownValue;
6736
- var update$31 = createClassErrorUpdate(
7024
+ var update$32 = createClassErrorUpdate(
6737
7025
  root,
6738
7026
  wakeable,
6739
7027
  thrownValue
6740
7028
  );
6741
- enqueueCapturedUpdate(root, update$31);
7029
+ enqueueCapturedUpdate(root, update$32);
6742
7030
  break a;
6743
7031
  }
6744
7032
  }
@@ -6777,8 +7065,8 @@ function renderRootSync(root, lanes) {
6777
7065
  var prevExecutionContext = executionContext;
6778
7066
  executionContext |= 2;
6779
7067
  var prevDispatcher = pushDispatcher();
6780
- (workInProgressRoot === root && workInProgressRootRenderLanes === lanes) ||
6781
- prepareFreshStack(root, lanes);
7068
+ if (workInProgressRoot !== root || workInProgressRootRenderLanes !== lanes)
7069
+ (workInProgressTransitions = null), prepareFreshStack(root, lanes);
6782
7070
  do
6783
7071
  try {
6784
7072
  workLoopSync();
@@ -6850,50 +7138,60 @@ function completeUnitOfWork(unitOfWork) {
6850
7138
  } while (null !== completedWork);
6851
7139
  0 === workInProgressRootExitStatus && (workInProgressRootExitStatus = 5);
6852
7140
  }
6853
- function commitRoot(root, recoverableErrors) {
7141
+ function commitRoot(root, recoverableErrors, transitions) {
6854
7142
  var previousUpdateLanePriority = currentUpdatePriority,
6855
7143
  prevTransition = ReactCurrentBatchConfig$2.transition;
6856
7144
  try {
6857
7145
  (ReactCurrentBatchConfig$2.transition = null),
6858
7146
  (currentUpdatePriority = 1),
6859
- commitRootImpl(root, recoverableErrors, previousUpdateLanePriority);
7147
+ commitRootImpl(
7148
+ root,
7149
+ recoverableErrors,
7150
+ transitions,
7151
+ previousUpdateLanePriority
7152
+ );
6860
7153
  } finally {
6861
7154
  (ReactCurrentBatchConfig$2.transition = prevTransition),
6862
7155
  (currentUpdatePriority = previousUpdateLanePriority);
6863
7156
  }
6864
7157
  return null;
6865
7158
  }
6866
- function commitRootImpl(root, recoverableErrors, renderPriorityLevel) {
7159
+ function commitRootImpl(
7160
+ root,
7161
+ recoverableErrors,
7162
+ transitions,
7163
+ renderPriorityLevel
7164
+ ) {
6867
7165
  do flushPassiveEffects();
6868
7166
  while (null !== rootWithPendingPassiveEffects);
6869
7167
  if (0 !== (executionContext & 6))
6870
7168
  throw Error("Should not already be working.");
6871
- var finishedWork = root.finishedWork,
6872
- lanes = root.finishedLanes;
6873
- if (null === finishedWork) return null;
7169
+ transitions = root.finishedWork;
7170
+ var lanes = root.finishedLanes;
7171
+ if (null === transitions) return null;
6874
7172
  root.finishedWork = null;
6875
7173
  root.finishedLanes = 0;
6876
- if (finishedWork === root.current)
7174
+ if (transitions === root.current)
6877
7175
  throw Error(
6878
7176
  "Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue."
6879
7177
  );
6880
7178
  root.callbackNode = null;
6881
7179
  root.callbackPriority = 0;
6882
- var remainingLanes = finishedWork.lanes | finishedWork.childLanes;
7180
+ var remainingLanes = transitions.lanes | transitions.childLanes;
6883
7181
  markRootFinished(root, remainingLanes);
6884
7182
  root === workInProgressRoot &&
6885
7183
  ((workInProgress = workInProgressRoot = null),
6886
7184
  (workInProgressRootRenderLanes = 0));
6887
- (0 === (finishedWork.subtreeFlags & 2064) &&
6888
- 0 === (finishedWork.flags & 2064)) ||
7185
+ (0 === (transitions.subtreeFlags & 2064) &&
7186
+ 0 === (transitions.flags & 2064)) ||
6889
7187
  rootDoesHavePassiveEffects ||
6890
7188
  ((rootDoesHavePassiveEffects = !0),
6891
7189
  scheduleCallback$1(NormalPriority, function() {
6892
7190
  flushPassiveEffects();
6893
7191
  return null;
6894
7192
  }));
6895
- remainingLanes = 0 !== (finishedWork.flags & 15990);
6896
- if (0 !== (finishedWork.subtreeFlags & 15990) || remainingLanes) {
7193
+ remainingLanes = 0 !== (transitions.flags & 15990);
7194
+ if (0 !== (transitions.subtreeFlags & 15990) || remainingLanes) {
6897
7195
  remainingLanes = ReactCurrentBatchConfig$2.transition;
6898
7196
  ReactCurrentBatchConfig$2.transition = null;
6899
7197
  var previousPriority = currentUpdatePriority;
@@ -6901,30 +7199,30 @@ function commitRootImpl(root, recoverableErrors, renderPriorityLevel) {
6901
7199
  var prevExecutionContext = executionContext;
6902
7200
  executionContext |= 4;
6903
7201
  ReactCurrentOwner$2.current = null;
6904
- commitBeforeMutationEffects(root, finishedWork);
6905
- commitMutationEffects(root, finishedWork, lanes);
6906
- root.current = finishedWork;
6907
- commitLayoutEffects(finishedWork, root, lanes);
7202
+ commitBeforeMutationEffects(root, transitions);
7203
+ commitMutationEffectsOnFiber(transitions, root);
7204
+ root.current = transitions;
7205
+ commitLayoutEffects(transitions, root, lanes);
6908
7206
  requestPaint();
6909
7207
  executionContext = prevExecutionContext;
6910
7208
  currentUpdatePriority = previousPriority;
6911
7209
  ReactCurrentBatchConfig$2.transition = remainingLanes;
6912
- } else root.current = finishedWork;
7210
+ } else root.current = transitions;
6913
7211
  rootDoesHavePassiveEffects &&
6914
7212
  ((rootDoesHavePassiveEffects = !1),
6915
7213
  (rootWithPendingPassiveEffects = root),
6916
7214
  (pendingPassiveEffectsLanes = lanes));
6917
7215
  remainingLanes = root.pendingLanes;
6918
7216
  0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null);
6919
- onCommitRoot(finishedWork.stateNode, renderPriorityLevel);
7217
+ onCommitRoot(transitions.stateNode, renderPriorityLevel);
6920
7218
  ensureRootIsScheduled(root, now());
6921
7219
  if (null !== recoverableErrors)
6922
7220
  for (
6923
- renderPriorityLevel = root.onRecoverableError, finishedWork = 0;
6924
- finishedWork < recoverableErrors.length;
6925
- finishedWork++
7221
+ renderPriorityLevel = root.onRecoverableError, transitions = 0;
7222
+ transitions < recoverableErrors.length;
7223
+ transitions++
6926
7224
  )
6927
- renderPriorityLevel(recoverableErrors[finishedWork]);
7225
+ renderPriorityLevel(recoverableErrors[transitions]);
6928
7226
  if (hasUncaughtError)
6929
7227
  throw ((hasUncaughtError = !1),
6930
7228
  (root = firstUncaughtError),
@@ -7159,21 +7457,43 @@ function pingSuspendedRoot(root, wakeable, pingedLanes) {
7159
7457
  : (workInProgressRootPingedLanes |= pingedLanes));
7160
7458
  ensureRootIsScheduled(root, wakeable);
7161
7459
  }
7162
- function resolveRetryWakeable(boundaryFiber, wakeable) {
7163
- var retryCache = boundaryFiber.stateNode;
7164
- null !== retryCache && retryCache.delete(wakeable);
7165
- wakeable = 0;
7166
- 0 === wakeable &&
7460
+ function retryTimedOutBoundary(boundaryFiber, retryLane) {
7461
+ 0 === retryLane &&
7167
7462
  (0 === (boundaryFiber.mode & 1)
7168
- ? (wakeable = 1)
7169
- : ((wakeable = nextRetryLane),
7463
+ ? (retryLane = 1)
7464
+ : ((retryLane = nextRetryLane),
7170
7465
  (nextRetryLane <<= 1),
7171
7466
  0 === (nextRetryLane & 130023424) && (nextRetryLane = 4194304)));
7172
- retryCache = requestEventTime();
7173
- boundaryFiber = markUpdateLaneFromFiberToRoot(boundaryFiber, wakeable);
7467
+ var eventTime = requestEventTime();
7468
+ boundaryFiber = markUpdateLaneFromFiberToRoot(boundaryFiber, retryLane);
7174
7469
  null !== boundaryFiber &&
7175
- (markRootUpdated(boundaryFiber, wakeable, retryCache),
7176
- ensureRootIsScheduled(boundaryFiber, retryCache));
7470
+ (markRootUpdated(boundaryFiber, retryLane, eventTime),
7471
+ ensureRootIsScheduled(boundaryFiber, eventTime));
7472
+ }
7473
+ function retryDehydratedSuspenseBoundary(boundaryFiber) {
7474
+ var suspenseState = boundaryFiber.memoizedState,
7475
+ retryLane = 0;
7476
+ null !== suspenseState && (retryLane = suspenseState.retryLane);
7477
+ retryTimedOutBoundary(boundaryFiber, retryLane);
7478
+ }
7479
+ function resolveRetryWakeable(boundaryFiber, wakeable) {
7480
+ var retryLane = 0;
7481
+ switch (boundaryFiber.tag) {
7482
+ case 13:
7483
+ var retryCache = boundaryFiber.stateNode;
7484
+ var suspenseState = boundaryFiber.memoizedState;
7485
+ null !== suspenseState && (retryLane = suspenseState.retryLane);
7486
+ break;
7487
+ case 19:
7488
+ retryCache = boundaryFiber.stateNode;
7489
+ break;
7490
+ default:
7491
+ throw Error(
7492
+ "Pinged unknown suspense boundary type. This is probably a bug in React."
7493
+ );
7494
+ }
7495
+ null !== retryCache && retryCache.delete(wakeable);
7496
+ retryTimedOutBoundary(boundaryFiber, retryLane);
7177
7497
  }
7178
7498
  var beginWork$1;
7179
7499
  beginWork$1 = function(current, workInProgress, renderLanes) {
@@ -7203,10 +7523,7 @@ beginWork$1 = function(current, workInProgress, renderLanes) {
7203
7523
  switch (workInProgress.tag) {
7204
7524
  case 2:
7205
7525
  var Component = workInProgress.type;
7206
- null !== current &&
7207
- ((current.alternate = null),
7208
- (workInProgress.alternate = null),
7209
- (workInProgress.flags |= 2));
7526
+ resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress);
7210
7527
  current = workInProgress.pendingProps;
7211
7528
  var context = getMaskedContext(
7212
7529
  workInProgress,
@@ -7260,10 +7577,7 @@ beginWork$1 = function(current, workInProgress, renderLanes) {
7260
7577
  case 16:
7261
7578
  Component = workInProgress.elementType;
7262
7579
  a: {
7263
- null !== current &&
7264
- ((current.alternate = null),
7265
- (workInProgress.alternate = null),
7266
- (workInProgress.flags |= 2));
7580
+ resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress);
7267
7581
  current = workInProgress.pendingProps;
7268
7582
  context = Component._init;
7269
7583
  Component = context(Component._payload);
@@ -7369,7 +7683,7 @@ beginWork$1 = function(current, workInProgress, renderLanes) {
7369
7683
  return (
7370
7684
  pushHostContext(workInProgress),
7371
7685
  (Component = workInProgress.pendingProps.children),
7372
- markRef$1(current, workInProgress),
7686
+ markRef(current, workInProgress),
7373
7687
  reconcileChildren(current, workInProgress, Component, renderLanes),
7374
7688
  workInProgress.child
7375
7689
  );
@@ -7463,24 +7777,24 @@ beginWork$1 = function(current, workInProgress, renderLanes) {
7463
7777
  }
7464
7778
  } else
7465
7779
  for (
7466
- newValue = workInProgress.child,
7467
- null !== newValue && (newValue.return = workInProgress);
7468
- null !== newValue;
7780
+ hasContext = workInProgress.child,
7781
+ null !== hasContext && (hasContext.return = workInProgress);
7782
+ null !== hasContext;
7469
7783
 
7470
7784
  ) {
7471
- var list = newValue.dependencies;
7785
+ var list = hasContext.dependencies;
7472
7786
  if (null !== list) {
7473
- hasContext = newValue.child;
7787
+ newValue = hasContext.child;
7474
7788
  for (
7475
7789
  var dependency = list.firstContext;
7476
7790
  null !== dependency;
7477
7791
 
7478
7792
  ) {
7479
7793
  if (dependency.context === Component) {
7480
- if (1 === newValue.tag) {
7794
+ if (1 === hasContext.tag) {
7481
7795
  dependency = createUpdate(-1, renderLanes & -renderLanes);
7482
7796
  dependency.tag = 2;
7483
- var updateQueue = newValue.updateQueue;
7797
+ var updateQueue = hasContext.updateQueue;
7484
7798
  if (null !== updateQueue) {
7485
7799
  updateQueue = updateQueue.shared;
7486
7800
  var pending = updateQueue.pending;
@@ -7491,11 +7805,11 @@ beginWork$1 = function(current, workInProgress, renderLanes) {
7491
7805
  updateQueue.pending = dependency;
7492
7806
  }
7493
7807
  }
7494
- newValue.lanes |= renderLanes;
7495
- dependency = newValue.alternate;
7808
+ hasContext.lanes |= renderLanes;
7809
+ dependency = hasContext.alternate;
7496
7810
  null !== dependency && (dependency.lanes |= renderLanes);
7497
7811
  scheduleContextWorkOnParentPath(
7498
- newValue.return,
7812
+ hasContext.return,
7499
7813
  renderLanes,
7500
7814
  workInProgress
7501
7815
  );
@@ -7504,29 +7818,43 @@ beginWork$1 = function(current, workInProgress, renderLanes) {
7504
7818
  }
7505
7819
  dependency = dependency.next;
7506
7820
  }
7507
- } else
7508
- hasContext =
7509
- 10 === newValue.tag
7510
- ? newValue.type === workInProgress.type
7511
- ? null
7512
- : newValue.child
7513
- : newValue.child;
7514
- if (null !== hasContext) hasContext.return = newValue;
7821
+ } else if (10 === hasContext.tag)
7822
+ newValue =
7823
+ hasContext.type === workInProgress.type
7824
+ ? null
7825
+ : hasContext.child;
7826
+ else if (18 === hasContext.tag) {
7827
+ newValue = hasContext.return;
7828
+ if (null === newValue)
7829
+ throw Error(
7830
+ "We just came from a parent so we must have had a parent. This is a bug in React."
7831
+ );
7832
+ newValue.lanes |= renderLanes;
7833
+ list = newValue.alternate;
7834
+ null !== list && (list.lanes |= renderLanes);
7835
+ scheduleContextWorkOnParentPath(
7836
+ newValue,
7837
+ renderLanes,
7838
+ workInProgress
7839
+ );
7840
+ newValue = hasContext.sibling;
7841
+ } else newValue = hasContext.child;
7842
+ if (null !== newValue) newValue.return = hasContext;
7515
7843
  else
7516
- for (hasContext = newValue; null !== hasContext; ) {
7517
- if (hasContext === workInProgress) {
7518
- hasContext = null;
7844
+ for (newValue = hasContext; null !== newValue; ) {
7845
+ if (newValue === workInProgress) {
7846
+ newValue = null;
7519
7847
  break;
7520
7848
  }
7521
- newValue = hasContext.sibling;
7522
- if (null !== newValue) {
7523
- newValue.return = hasContext.return;
7524
- hasContext = newValue;
7849
+ hasContext = newValue.sibling;
7850
+ if (null !== hasContext) {
7851
+ hasContext.return = newValue.return;
7852
+ newValue = hasContext;
7525
7853
  break;
7526
7854
  }
7527
- hasContext = hasContext.return;
7855
+ newValue = newValue.return;
7528
7856
  }
7529
- newValue = hasContext;
7857
+ hasContext = newValue;
7530
7858
  }
7531
7859
  reconcileChildren(
7532
7860
  current,
@@ -7577,10 +7905,7 @@ beginWork$1 = function(current, workInProgress, renderLanes) {
7577
7905
  workInProgress.elementType === Component
7578
7906
  ? context
7579
7907
  : resolveDefaultProps(Component, context)),
7580
- null !== current &&
7581
- ((current.alternate = null),
7582
- (workInProgress.alternate = null),
7583
- (workInProgress.flags |= 2)),
7908
+ resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress),
7584
7909
  (workInProgress.tag = 1),
7585
7910
  isContextProvider(Component)
7586
7911
  ? ((current = !0), pushContextProvider(workInProgress))
@@ -7920,10 +8245,10 @@ batchedUpdatesImpl = function(fn, a) {
7920
8245
  }
7921
8246
  };
7922
8247
  var roots = new Map(),
7923
- devToolsConfig$jscomp$inline_934 = {
8248
+ devToolsConfig$jscomp$inline_925 = {
7924
8249
  findFiberByHostInstance: getInstanceFromInstance,
7925
8250
  bundleType: 0,
7926
- version: "18.0.0-experimental-34aa5cfe0-20220329",
8251
+ version: "18.2.0-next-d300cebde-20220601",
7927
8252
  rendererPackageName: "react-native-renderer",
7928
8253
  rendererConfig: {
7929
8254
  getInspectorDataForViewTag: function() {
@@ -7938,11 +8263,11 @@ var roots = new Map(),
7938
8263
  }.bind(null, findNodeHandle)
7939
8264
  }
7940
8265
  };
7941
- var internals$jscomp$inline_1178 = {
7942
- bundleType: devToolsConfig$jscomp$inline_934.bundleType,
7943
- version: devToolsConfig$jscomp$inline_934.version,
7944
- rendererPackageName: devToolsConfig$jscomp$inline_934.rendererPackageName,
7945
- rendererConfig: devToolsConfig$jscomp$inline_934.rendererConfig,
8266
+ var internals$jscomp$inline_1171 = {
8267
+ bundleType: devToolsConfig$jscomp$inline_925.bundleType,
8268
+ version: devToolsConfig$jscomp$inline_925.version,
8269
+ rendererPackageName: devToolsConfig$jscomp$inline_925.rendererPackageName,
8270
+ rendererConfig: devToolsConfig$jscomp$inline_925.rendererConfig,
7946
8271
  overrideHookState: null,
7947
8272
  overrideHookStateDeletePath: null,
7948
8273
  overrideHookStateRenamePath: null,
@@ -7958,26 +8283,26 @@ var internals$jscomp$inline_1178 = {
7958
8283
  return null === fiber ? null : fiber.stateNode;
7959
8284
  },
7960
8285
  findFiberByHostInstance:
7961
- devToolsConfig$jscomp$inline_934.findFiberByHostInstance ||
8286
+ devToolsConfig$jscomp$inline_925.findFiberByHostInstance ||
7962
8287
  emptyFindFiberByHostInstance,
7963
8288
  findHostInstancesForRefresh: null,
7964
8289
  scheduleRefresh: null,
7965
8290
  scheduleRoot: null,
7966
8291
  setRefreshHandler: null,
7967
8292
  getCurrentFiber: null,
7968
- reconcilerVersion: "18.0.0-experimental-34aa5cfe0-20220329"
8293
+ reconcilerVersion: "18.2.0-next-d300cebde-20220601"
7969
8294
  };
7970
8295
  if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
7971
- var hook$jscomp$inline_1179 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
8296
+ var hook$jscomp$inline_1172 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
7972
8297
  if (
7973
- !hook$jscomp$inline_1179.isDisabled &&
7974
- hook$jscomp$inline_1179.supportsFiber
8298
+ !hook$jscomp$inline_1172.isDisabled &&
8299
+ hook$jscomp$inline_1172.supportsFiber
7975
8300
  )
7976
8301
  try {
7977
- (rendererID = hook$jscomp$inline_1179.inject(
7978
- internals$jscomp$inline_1178
8302
+ (rendererID = hook$jscomp$inline_1172.inject(
8303
+ internals$jscomp$inline_1171
7979
8304
  )),
7980
- (injectedHook = hook$jscomp$inline_1179);
8305
+ (injectedHook = hook$jscomp$inline_1172);
7981
8306
  } catch (err) {}
7982
8307
  }
7983
8308
  exports.createPortal = function(children, containerTag) {
@@ -8032,7 +8357,8 @@ exports.render = function(element, containerTag, callback, concurrentRoot) {
8032
8357
  element: null,
8033
8358
  isDehydrated: !1,
8034
8359
  cache: null,
8035
- transitions: null
8360
+ transitions: null,
8361
+ pendingSuspenseBoundaries: null
8036
8362
  }),
8037
8363
  initializeUpdateQueue(root),
8038
8364
  (root = concurrentRoot),