@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 ReactNativeRenderer-prod
10
10
  * @preventMunge
11
- * @generated SignedSource<<08a279093988c36b477bd72fa59e144d>>
11
+ * @generated SignedSource<<9f59a543175acb00b00023e9ed7d8c38>>
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_220 = {
1020
+ var injectedNamesToPlugins$jscomp$inline_225 = {
1021
1021
  ResponderEventPlugin: ResponderEventPlugin,
1022
1022
  ReactNativeBridgeEventPlugin: {
1023
1023
  eventTypes: {},
@@ -1063,33 +1063,33 @@ var injectedNamesToPlugins$jscomp$inline_220 = {
1063
1063
  }
1064
1064
  }
1065
1065
  },
1066
- isOrderingDirty$jscomp$inline_221 = !1,
1067
- pluginName$jscomp$inline_222;
1068
- for (pluginName$jscomp$inline_222 in injectedNamesToPlugins$jscomp$inline_220)
1066
+ isOrderingDirty$jscomp$inline_226 = !1,
1067
+ pluginName$jscomp$inline_227;
1068
+ for (pluginName$jscomp$inline_227 in injectedNamesToPlugins$jscomp$inline_225)
1069
1069
  if (
1070
- injectedNamesToPlugins$jscomp$inline_220.hasOwnProperty(
1071
- pluginName$jscomp$inline_222
1070
+ injectedNamesToPlugins$jscomp$inline_225.hasOwnProperty(
1071
+ pluginName$jscomp$inline_227
1072
1072
  )
1073
1073
  ) {
1074
- var pluginModule$jscomp$inline_223 =
1075
- injectedNamesToPlugins$jscomp$inline_220[pluginName$jscomp$inline_222];
1074
+ var pluginModule$jscomp$inline_228 =
1075
+ injectedNamesToPlugins$jscomp$inline_225[pluginName$jscomp$inline_227];
1076
1076
  if (
1077
- !namesToPlugins.hasOwnProperty(pluginName$jscomp$inline_222) ||
1078
- namesToPlugins[pluginName$jscomp$inline_222] !==
1079
- pluginModule$jscomp$inline_223
1077
+ !namesToPlugins.hasOwnProperty(pluginName$jscomp$inline_227) ||
1078
+ namesToPlugins[pluginName$jscomp$inline_227] !==
1079
+ pluginModule$jscomp$inline_228
1080
1080
  ) {
1081
- if (namesToPlugins[pluginName$jscomp$inline_222])
1081
+ if (namesToPlugins[pluginName$jscomp$inline_227])
1082
1082
  throw Error(
1083
1083
  "EventPluginRegistry: Cannot inject two different event plugins using the same name, `" +
1084
- (pluginName$jscomp$inline_222 + "`.")
1084
+ (pluginName$jscomp$inline_227 + "`.")
1085
1085
  );
1086
1086
  namesToPlugins[
1087
- pluginName$jscomp$inline_222
1088
- ] = pluginModule$jscomp$inline_223;
1089
- isOrderingDirty$jscomp$inline_221 = !0;
1087
+ pluginName$jscomp$inline_227
1088
+ ] = pluginModule$jscomp$inline_228;
1089
+ isOrderingDirty$jscomp$inline_226 = !0;
1090
1090
  }
1091
1091
  }
1092
- isOrderingDirty$jscomp$inline_221 && recomputePluginOrdering();
1092
+ isOrderingDirty$jscomp$inline_226 && recomputePluginOrdering();
1093
1093
  var instanceCache = new Map(),
1094
1094
  instanceProps = new Map();
1095
1095
  function getInstanceFromTag(tag) {
@@ -1923,6 +1923,12 @@ function getLanesToRetrySynchronouslyOnError(root) {
1923
1923
  root = root.pendingLanes & -1073741825;
1924
1924
  return 0 !== root ? root : root & 1073741824 ? 1073741824 : 0;
1925
1925
  }
1926
+ function claimNextTransitionLane() {
1927
+ var lane = nextTransitionLane;
1928
+ nextTransitionLane <<= 1;
1929
+ 0 === (nextTransitionLane & 4194240) && (nextTransitionLane = 64);
1930
+ return lane;
1931
+ }
1926
1932
  function createLaneMap(initial) {
1927
1933
  for (var laneMap = [], i = 0; 31 > i; i++) laneMap.push(initial);
1928
1934
  return laneMap;
@@ -2152,7 +2158,28 @@ function flushSyncCallbacks() {
2152
2158
  }
2153
2159
  return null;
2154
2160
  }
2155
- var ReactCurrentBatchConfig = ReactSharedInternals.ReactCurrentBatchConfig;
2161
+ var forkStack = [],
2162
+ forkStackIndex = 0,
2163
+ treeForkProvider = null,
2164
+ idStack = [],
2165
+ idStackIndex = 0,
2166
+ treeContextProvider = null;
2167
+ function popTreeContext(workInProgress) {
2168
+ for (; workInProgress === treeForkProvider; )
2169
+ (treeForkProvider = forkStack[--forkStackIndex]),
2170
+ (forkStack[forkStackIndex] = null),
2171
+ --forkStackIndex,
2172
+ (forkStack[forkStackIndex] = null);
2173
+ for (; workInProgress === treeContextProvider; )
2174
+ (treeContextProvider = idStack[--idStackIndex]),
2175
+ (idStack[idStackIndex] = null),
2176
+ --idStackIndex,
2177
+ (idStack[idStackIndex] = null),
2178
+ --idStackIndex,
2179
+ (idStack[idStackIndex] = null);
2180
+ }
2181
+ var hydrationErrors = null,
2182
+ ReactCurrentBatchConfig = ReactSharedInternals.ReactCurrentBatchConfig;
2156
2183
  function shallowEqual(objA, objB) {
2157
2184
  if (objectIs(objA, objB)) return !0;
2158
2185
  if (
@@ -2309,9 +2336,7 @@ function enqueueUpdate(fiber, update) {
2309
2336
  var updateQueue = fiber.updateQueue;
2310
2337
  null !== updateQueue &&
2311
2338
  ((updateQueue = updateQueue.shared),
2312
- null !== workInProgressRoot &&
2313
- 0 !== (fiber.mode & 1) &&
2314
- 0 === (executionContext & 2)
2339
+ isInterleavedUpdate(fiber)
2315
2340
  ? ((fiber = updateQueue.interleaved),
2316
2341
  null === fiber
2317
2342
  ? ((update.next = update),
@@ -2679,26 +2704,6 @@ function mountClassInstance(workInProgress, ctor, newProps, renderLanes) {
2679
2704
  "function" === typeof instance.componentDidMount &&
2680
2705
  (workInProgress.flags |= 4);
2681
2706
  }
2682
- var forkStack = [],
2683
- forkStackIndex = 0,
2684
- treeForkProvider = null,
2685
- idStack = [],
2686
- idStackIndex = 0,
2687
- treeContextProvider = null;
2688
- function popTreeContext(workInProgress) {
2689
- for (; workInProgress === treeForkProvider; )
2690
- (treeForkProvider = forkStack[--forkStackIndex]),
2691
- (forkStack[forkStackIndex] = null),
2692
- --forkStackIndex,
2693
- (forkStack[forkStackIndex] = null);
2694
- for (; workInProgress === treeContextProvider; )
2695
- (treeContextProvider = idStack[--idStackIndex]),
2696
- (idStack[idStackIndex] = null),
2697
- --idStackIndex,
2698
- (idStack[idStackIndex] = null),
2699
- --idStackIndex,
2700
- (idStack[idStackIndex] = null);
2701
- }
2702
2707
  function coerceRef(returnFiber, current, element) {
2703
2708
  returnFiber = element.ref;
2704
2709
  if (
@@ -2761,6 +2766,10 @@ function throwOnInvalidObjectType(returnFiber, newChild) {
2761
2766
  "). If you meant to render a collection of children, use an array instead."
2762
2767
  );
2763
2768
  }
2769
+ function resolveLazy(lazyType) {
2770
+ var init = lazyType._init;
2771
+ return init(lazyType._payload);
2772
+ }
2764
2773
  function ChildReconciler(shouldTrackSideEffects) {
2765
2774
  function deleteChild(returnFiber, childToDelete) {
2766
2775
  if (shouldTrackSideEffects) {
@@ -2833,7 +2842,14 @@ function ChildReconciler(shouldTrackSideEffects) {
2833
2842
  lanes,
2834
2843
  element.key
2835
2844
  );
2836
- if (null !== current && current.elementType === elementType)
2845
+ if (
2846
+ null !== current &&
2847
+ (current.elementType === elementType ||
2848
+ ("object" === typeof elementType &&
2849
+ null !== elementType &&
2850
+ elementType.$$typeof === REACT_LAZY_TYPE &&
2851
+ resolveLazy(elementType) === current.type))
2852
+ )
2837
2853
  return (
2838
2854
  (lanes = useFiber(current, element.props)),
2839
2855
  (lanes.ref = coerceRef(returnFiber, current, element)),
@@ -2924,6 +2940,9 @@ function ChildReconciler(shouldTrackSideEffects) {
2924
2940
  (newChild.return = returnFiber),
2925
2941
  newChild
2926
2942
  );
2943
+ case REACT_LAZY_TYPE:
2944
+ var init = newChild._init;
2945
+ return createChild(returnFiber, init(newChild._payload), lanes);
2927
2946
  }
2928
2947
  if (isArrayImpl(newChild) || getIteratorFn(newChild))
2929
2948
  return (
@@ -2959,6 +2978,11 @@ function ChildReconciler(shouldTrackSideEffects) {
2959
2978
  return newChild.key === key
2960
2979
  ? updatePortal(returnFiber, oldFiber, newChild, lanes)
2961
2980
  : null;
2981
+ case REACT_LAZY_TYPE:
2982
+ return (
2983
+ (key = newChild._init),
2984
+ updateSlot(returnFiber, oldFiber, key(newChild._payload), lanes)
2985
+ );
2962
2986
  }
2963
2987
  if (isArrayImpl(newChild) || getIteratorFn(newChild))
2964
2988
  return null !== key
@@ -3001,6 +3025,15 @@ function ChildReconciler(shouldTrackSideEffects) {
3001
3025
  ) || null),
3002
3026
  updatePortal(returnFiber, existingChildren, newChild, lanes)
3003
3027
  );
3028
+ case REACT_LAZY_TYPE:
3029
+ var init = newChild._init;
3030
+ return updateFromMap(
3031
+ existingChildren,
3032
+ returnFiber,
3033
+ newIdx,
3034
+ init(newChild._payload),
3035
+ lanes
3036
+ );
3004
3037
  }
3005
3038
  if (isArrayImpl(newChild) || getIteratorFn(newChild))
3006
3039
  return (
@@ -3178,7 +3211,12 @@ function ChildReconciler(shouldTrackSideEffects) {
3178
3211
  });
3179
3212
  return iteratorFn;
3180
3213
  }
3181
- return function(returnFiber, currentFirstChild, newChild, lanes) {
3214
+ function reconcileChildFibers(
3215
+ returnFiber,
3216
+ currentFirstChild,
3217
+ newChild,
3218
+ lanes
3219
+ ) {
3182
3220
  "object" === typeof newChild &&
3183
3221
  null !== newChild &&
3184
3222
  newChild.type === REACT_FRAGMENT_TYPE &&
@@ -3206,7 +3244,13 @@ function ChildReconciler(shouldTrackSideEffects) {
3206
3244
  returnFiber = currentFirstChild;
3207
3245
  break a;
3208
3246
  }
3209
- } else if (child.elementType === key) {
3247
+ } else if (
3248
+ child.elementType === key ||
3249
+ ("object" === typeof key &&
3250
+ null !== key &&
3251
+ key.$$typeof === REACT_LAZY_TYPE &&
3252
+ resolveLazy(key) === child.type)
3253
+ ) {
3210
3254
  deleteRemainingChildren(returnFiber, child.sibling);
3211
3255
  currentFirstChild = useFiber(child, newChild.props);
3212
3256
  currentFirstChild.ref = coerceRef(
@@ -3287,6 +3331,16 @@ function ChildReconciler(shouldTrackSideEffects) {
3287
3331
  returnFiber = currentFirstChild;
3288
3332
  }
3289
3333
  return placeSingleChild(returnFiber);
3334
+ case REACT_LAZY_TYPE:
3335
+ return (
3336
+ (child = newChild._init),
3337
+ reconcileChildFibers(
3338
+ returnFiber,
3339
+ currentFirstChild,
3340
+ child(newChild._payload),
3341
+ lanes
3342
+ )
3343
+ );
3290
3344
  }
3291
3345
  if (isArrayImpl(newChild))
3292
3346
  return reconcileChildrenArray(
@@ -3322,7 +3376,8 @@ function ChildReconciler(shouldTrackSideEffects) {
3322
3376
  (returnFiber = currentFirstChild)),
3323
3377
  placeSingleChild(returnFiber))
3324
3378
  : deleteRemainingChildren(returnFiber, currentFirstChild);
3325
- };
3379
+ }
3380
+ return reconcileChildFibers;
3326
3381
  }
3327
3382
  var reconcileChildFibers = ChildReconciler(!0),
3328
3383
  mountChildFibers = ChildReconciler(!1),
@@ -3809,6 +3864,19 @@ function updateMemo(nextCreate, deps) {
3809
3864
  hook.memoizedState = [nextCreate, deps];
3810
3865
  return nextCreate;
3811
3866
  }
3867
+ function updateDeferredValueImpl(hook, prevValue, value) {
3868
+ if (0 === (renderLanes & 21))
3869
+ return (
3870
+ hook.baseState && ((hook.baseState = !1), (didReceiveUpdate = !0)),
3871
+ (hook.memoizedState = value)
3872
+ );
3873
+ objectIs(value, prevValue) ||
3874
+ ((value = claimNextTransitionLane()),
3875
+ (currentlyRenderingFiber$1.lanes |= value),
3876
+ (workInProgressRootSkippedLanes |= value),
3877
+ (hook.baseState = !0));
3878
+ return prevValue;
3879
+ }
3812
3880
  function startTransition(setPending, callback) {
3813
3881
  var previousPriority = currentUpdatePriority;
3814
3882
  currentUpdatePriority =
@@ -3890,9 +3958,7 @@ function enqueueRenderPhaseUpdate(queue, update) {
3890
3958
  queue.pending = update;
3891
3959
  }
3892
3960
  function enqueueUpdate$1(fiber, queue, update) {
3893
- null !== workInProgressRoot &&
3894
- 0 !== (fiber.mode & 1) &&
3895
- 0 === (executionContext & 2)
3961
+ isInterleavedUpdate(fiber)
3896
3962
  ? ((fiber = queue.interleaved),
3897
3963
  null === fiber
3898
3964
  ? ((update.next = update),
@@ -3997,29 +4063,14 @@ var ContextOnlyDispatcher = {
3997
4063
  useState: mountState,
3998
4064
  useDebugValue: mountDebugValue,
3999
4065
  useDeferredValue: function(value) {
4000
- var _mountState = mountState(value),
4001
- prevValue = _mountState[0],
4002
- setValue = _mountState[1];
4003
- mountEffect(
4004
- function() {
4005
- var prevTransition = ReactCurrentBatchConfig$1.transition;
4006
- ReactCurrentBatchConfig$1.transition = {};
4007
- try {
4008
- setValue(value);
4009
- } finally {
4010
- ReactCurrentBatchConfig$1.transition = prevTransition;
4011
- }
4012
- },
4013
- [value]
4014
- );
4015
- return prevValue;
4066
+ return (mountWorkInProgressHook().memoizedState = value);
4016
4067
  },
4017
4068
  useTransition: function() {
4018
- var _mountState2 = mountState(!1),
4019
- isPending = _mountState2[0];
4020
- _mountState2 = startTransition.bind(null, _mountState2[1]);
4021
- mountWorkInProgressHook().memoizedState = _mountState2;
4022
- return [isPending, _mountState2];
4069
+ var _mountState = mountState(!1),
4070
+ isPending = _mountState[0];
4071
+ _mountState = startTransition.bind(null, _mountState[1]);
4072
+ mountWorkInProgressHook().memoizedState = _mountState;
4073
+ return [isPending, _mountState];
4023
4074
  },
4024
4075
  useMutableSource: function() {},
4025
4076
  useSyncExternalStore: function(subscribe, getSnapshot) {
@@ -4073,22 +4124,8 @@ var ContextOnlyDispatcher = {
4073
4124
  },
4074
4125
  useDebugValue: mountDebugValue,
4075
4126
  useDeferredValue: function(value) {
4076
- var _updateState = updateReducer(basicStateReducer),
4077
- prevValue = _updateState[0],
4078
- setValue = _updateState[1];
4079
- updateEffect(
4080
- function() {
4081
- var prevTransition = ReactCurrentBatchConfig$1.transition;
4082
- ReactCurrentBatchConfig$1.transition = {};
4083
- try {
4084
- setValue(value);
4085
- } finally {
4086
- ReactCurrentBatchConfig$1.transition = prevTransition;
4087
- }
4088
- },
4089
- [value]
4090
- );
4091
- return prevValue;
4127
+ var hook = updateWorkInProgressHook();
4128
+ return updateDeferredValueImpl(hook, currentHook.memoizedState, value);
4092
4129
  },
4093
4130
  useTransition: function() {
4094
4131
  var isPending = updateReducer(basicStateReducer)[0],
@@ -4116,22 +4153,10 @@ var ContextOnlyDispatcher = {
4116
4153
  },
4117
4154
  useDebugValue: mountDebugValue,
4118
4155
  useDeferredValue: function(value) {
4119
- var _rerenderState = rerenderReducer(basicStateReducer),
4120
- prevValue = _rerenderState[0],
4121
- setValue = _rerenderState[1];
4122
- updateEffect(
4123
- function() {
4124
- var prevTransition = ReactCurrentBatchConfig$1.transition;
4125
- ReactCurrentBatchConfig$1.transition = {};
4126
- try {
4127
- setValue(value);
4128
- } finally {
4129
- ReactCurrentBatchConfig$1.transition = prevTransition;
4130
- }
4131
- },
4132
- [value]
4133
- );
4134
- return prevValue;
4156
+ var hook = updateWorkInProgressHook();
4157
+ return null === currentHook
4158
+ ? (hook.memoizedState = value)
4159
+ : updateDeferredValueImpl(hook, currentHook.memoizedState, value);
4135
4160
  },
4136
4161
  useTransition: function() {
4137
4162
  var isPending = rerenderReducer(basicStateReducer)[0],
@@ -4228,454 +4253,72 @@ function attachPingListener(root, wakeable, lanes) {
4228
4253
  (root = pingSuspendedRoot.bind(null, root, wakeable, lanes)),
4229
4254
  wakeable.then(root, root));
4230
4255
  }
4231
- var appendAllChildren, updateHostContainer, updateHostComponent, updateHostText;
4232
- appendAllChildren = function(parent, workInProgress) {
4233
- for (var node = workInProgress.child; null !== node; ) {
4234
- if (5 === node.tag || 6 === node.tag) parent._children.push(node.stateNode);
4235
- else if (4 !== node.tag && null !== node.child) {
4236
- node.child.return = node;
4237
- node = node.child;
4238
- continue;
4239
- }
4240
- if (node === workInProgress) break;
4241
- for (; null === node.sibling; ) {
4242
- if (null === node.return || node.return === workInProgress) return;
4243
- node = node.return;
4244
- }
4245
- node.sibling.return = node.return;
4246
- node = node.sibling;
4247
- }
4248
- };
4249
- updateHostContainer = function() {};
4250
- updateHostComponent = function(current, workInProgress, type, newProps) {
4251
- current.memoizedProps !== newProps &&
4252
- (requiredContext(contextStackCursor$1.current),
4253
- (workInProgress.updateQueue = UPDATE_SIGNAL)) &&
4254
- (workInProgress.flags |= 4);
4255
- };
4256
- updateHostText = function(current, workInProgress, oldText, newText) {
4257
- oldText !== newText && (workInProgress.flags |= 4);
4258
- };
4259
- function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) {
4260
- switch (renderState.tailMode) {
4261
- case "hidden":
4262
- hasRenderedATailFallback = renderState.tail;
4263
- for (var lastTailNode = null; null !== hasRenderedATailFallback; )
4264
- null !== hasRenderedATailFallback.alternate &&
4265
- (lastTailNode = hasRenderedATailFallback),
4266
- (hasRenderedATailFallback = hasRenderedATailFallback.sibling);
4267
- null === lastTailNode
4268
- ? (renderState.tail = null)
4269
- : (lastTailNode.sibling = null);
4270
- break;
4271
- case "collapsed":
4272
- lastTailNode = renderState.tail;
4273
- for (var lastTailNode$35 = null; null !== lastTailNode; )
4274
- null !== lastTailNode.alternate && (lastTailNode$35 = lastTailNode),
4275
- (lastTailNode = lastTailNode.sibling);
4276
- null === lastTailNode$35
4277
- ? hasRenderedATailFallback || null === renderState.tail
4278
- ? (renderState.tail = null)
4279
- : (renderState.tail.sibling = null)
4280
- : (lastTailNode$35.sibling = null);
4281
- }
4256
+ var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner,
4257
+ didReceiveUpdate = !1;
4258
+ function reconcileChildren(current, workInProgress, nextChildren, renderLanes) {
4259
+ workInProgress.child =
4260
+ null === current
4261
+ ? mountChildFibers(workInProgress, null, nextChildren, renderLanes)
4262
+ : reconcileChildFibers(
4263
+ workInProgress,
4264
+ current.child,
4265
+ nextChildren,
4266
+ renderLanes
4267
+ );
4282
4268
  }
4283
- function bubbleProperties(completedWork) {
4284
- var didBailout =
4285
- null !== completedWork.alternate &&
4286
- completedWork.alternate.child === completedWork.child,
4287
- newChildLanes = 0,
4288
- subtreeFlags = 0;
4289
- if (didBailout)
4290
- for (var child$36 = completedWork.child; null !== child$36; )
4291
- (newChildLanes |= child$36.lanes | child$36.childLanes),
4292
- (subtreeFlags |= child$36.subtreeFlags & 14680064),
4293
- (subtreeFlags |= child$36.flags & 14680064),
4294
- (child$36.return = completedWork),
4295
- (child$36 = child$36.sibling);
4296
- else
4297
- for (child$36 = completedWork.child; null !== child$36; )
4298
- (newChildLanes |= child$36.lanes | child$36.childLanes),
4299
- (subtreeFlags |= child$36.subtreeFlags),
4300
- (subtreeFlags |= child$36.flags),
4301
- (child$36.return = completedWork),
4302
- (child$36 = child$36.sibling);
4303
- completedWork.subtreeFlags |= subtreeFlags;
4304
- completedWork.childLanes = newChildLanes;
4305
- return didBailout;
4269
+ function updateForwardRef(
4270
+ current,
4271
+ workInProgress,
4272
+ Component,
4273
+ nextProps,
4274
+ renderLanes
4275
+ ) {
4276
+ Component = Component.render;
4277
+ var ref = workInProgress.ref;
4278
+ prepareToReadContext(workInProgress, renderLanes);
4279
+ nextProps = renderWithHooks(
4280
+ current,
4281
+ workInProgress,
4282
+ Component,
4283
+ nextProps,
4284
+ ref,
4285
+ renderLanes
4286
+ );
4287
+ if (null !== current && !didReceiveUpdate)
4288
+ return (
4289
+ (workInProgress.updateQueue = current.updateQueue),
4290
+ (workInProgress.flags &= -2053),
4291
+ (current.lanes &= ~renderLanes),
4292
+ bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes)
4293
+ );
4294
+ workInProgress.flags |= 1;
4295
+ reconcileChildren(current, workInProgress, nextProps, renderLanes);
4296
+ return workInProgress.child;
4306
4297
  }
4307
- function completeWork(current, workInProgress, renderLanes) {
4308
- var newProps = workInProgress.pendingProps;
4309
- popTreeContext(workInProgress);
4310
- switch (workInProgress.tag) {
4311
- case 2:
4312
- case 16:
4313
- case 15:
4314
- case 0:
4315
- case 11:
4316
- case 7:
4317
- case 8:
4318
- case 12:
4319
- case 9:
4320
- case 14:
4321
- return bubbleProperties(workInProgress), null;
4322
- case 1:
4323
- return (
4324
- isContextProvider(workInProgress.type) && popContext(),
4325
- bubbleProperties(workInProgress),
4326
- null
4327
- );
4328
- case 3:
4298
+ function updateMemoComponent(
4299
+ current,
4300
+ workInProgress,
4301
+ Component,
4302
+ nextProps,
4303
+ renderLanes
4304
+ ) {
4305
+ if (null === current) {
4306
+ var type = Component.type;
4307
+ if (
4308
+ "function" === typeof type &&
4309
+ !shouldConstruct(type) &&
4310
+ void 0 === type.defaultProps &&
4311
+ null === Component.compare &&
4312
+ void 0 === Component.defaultProps
4313
+ )
4329
4314
  return (
4330
- (newProps = workInProgress.stateNode),
4331
- popHostContainer(),
4332
- pop(didPerformWorkStackCursor),
4333
- pop(contextStackCursor),
4334
- resetWorkInProgressVersions(),
4335
- newProps.pendingContext &&
4336
- ((newProps.context = newProps.pendingContext),
4337
- (newProps.pendingContext = null)),
4338
- (null !== current && null !== current.child) ||
4339
- null === current ||
4340
- (current.memoizedState.isDehydrated &&
4341
- 0 === (workInProgress.flags & 256)) ||
4342
- (workInProgress.flags |= 1024),
4343
- updateHostContainer(current, workInProgress),
4344
- bubbleProperties(workInProgress),
4345
- null
4346
- );
4347
- case 5:
4348
- popHostContext(workInProgress);
4349
- renderLanes = requiredContext(rootInstanceStackCursor.current);
4350
- var type = workInProgress.type;
4351
- if (null !== current && null != workInProgress.stateNode)
4352
- updateHostComponent(
4315
+ (workInProgress.tag = 15),
4316
+ (workInProgress.type = type),
4317
+ updateSimpleMemoComponent(
4353
4318
  current,
4354
4319
  workInProgress,
4355
4320
  type,
4356
- newProps,
4357
- renderLanes
4358
- ),
4359
- current.ref !== workInProgress.ref && (workInProgress.flags |= 512);
4360
- else {
4361
- if (!newProps) {
4362
- if (null === workInProgress.stateNode)
4363
- throw Error(
4364
- "We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue."
4365
- );
4366
- bubbleProperties(workInProgress);
4367
- return null;
4368
- }
4369
- requiredContext(contextStackCursor$1.current);
4370
- current = allocateTag();
4371
- type = getViewConfigForType(type);
4372
- var updatePayload = diffProperties(
4373
- null,
4374
- emptyObject,
4375
- newProps,
4376
- type.validAttributes
4377
- );
4378
- ReactNativePrivateInterface.UIManager.createView(
4379
- current,
4380
- type.uiViewClassName,
4381
- renderLanes,
4382
- updatePayload
4383
- );
4384
- renderLanes = new ReactNativeFiberHostComponent(
4385
- current,
4386
- type,
4387
- workInProgress
4388
- );
4389
- instanceCache.set(current, workInProgress);
4390
- instanceProps.set(current, newProps);
4391
- appendAllChildren(renderLanes, workInProgress, !1, !1);
4392
- workInProgress.stateNode = renderLanes;
4393
- finalizeInitialChildren(renderLanes) && (workInProgress.flags |= 4);
4394
- null !== workInProgress.ref && (workInProgress.flags |= 512);
4395
- }
4396
- bubbleProperties(workInProgress);
4397
- return null;
4398
- case 6:
4399
- if (current && null != workInProgress.stateNode)
4400
- updateHostText(
4401
- current,
4402
- workInProgress,
4403
- current.memoizedProps,
4404
- newProps
4405
- );
4406
- else {
4407
- if ("string" !== typeof newProps && null === workInProgress.stateNode)
4408
- throw Error(
4409
- "We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue."
4410
- );
4411
- current = requiredContext(rootInstanceStackCursor.current);
4412
- if (!requiredContext(contextStackCursor$1.current).isInAParentText)
4413
- throw Error(
4414
- "Text strings must be rendered within a <Text> component."
4415
- );
4416
- renderLanes = allocateTag();
4417
- ReactNativePrivateInterface.UIManager.createView(
4418
- renderLanes,
4419
- "RCTRawText",
4420
- current,
4421
- { text: newProps }
4422
- );
4423
- instanceCache.set(renderLanes, workInProgress);
4424
- workInProgress.stateNode = renderLanes;
4425
- }
4426
- bubbleProperties(workInProgress);
4427
- return null;
4428
- case 13:
4429
- pop(suspenseStackCursor);
4430
- newProps = workInProgress.memoizedState;
4431
- if (0 !== (workInProgress.flags & 128))
4432
- return (workInProgress.lanes = renderLanes), workInProgress;
4433
- renderLanes = !1;
4434
- null !== current && (renderLanes = null !== current.memoizedState);
4435
- null === newProps ||
4436
- renderLanes ||
4437
- ((workInProgress.child.flags |= 8192),
4438
- 0 !== (workInProgress.mode & 1) &&
4439
- (null === current || 0 !== (suspenseStackCursor.current & 1)
4440
- ? 0 === workInProgressRootExitStatus &&
4441
- (workInProgressRootExitStatus = 3)
4442
- : renderDidSuspendDelayIfPossible()));
4443
- null !== workInProgress.updateQueue && (workInProgress.flags |= 4);
4444
- bubbleProperties(workInProgress);
4445
- return null;
4446
- case 4:
4447
- return (
4448
- popHostContainer(),
4449
- updateHostContainer(current, workInProgress),
4450
- bubbleProperties(workInProgress),
4451
- null
4452
- );
4453
- case 10:
4454
- return (
4455
- popProvider(workInProgress.type._context),
4456
- bubbleProperties(workInProgress),
4457
- null
4458
- );
4459
- case 17:
4460
- return (
4461
- isContextProvider(workInProgress.type) && popContext(),
4462
- bubbleProperties(workInProgress),
4463
- null
4464
- );
4465
- case 19:
4466
- pop(suspenseStackCursor);
4467
- type = workInProgress.memoizedState;
4468
- if (null === type) return bubbleProperties(workInProgress), null;
4469
- newProps = 0 !== (workInProgress.flags & 128);
4470
- updatePayload = type.rendering;
4471
- if (null === updatePayload)
4472
- if (newProps) cutOffTailIfNeeded(type, !1);
4473
- else {
4474
- if (
4475
- 0 !== workInProgressRootExitStatus ||
4476
- (null !== current && 0 !== (current.flags & 128))
4477
- )
4478
- for (current = workInProgress.child; null !== current; ) {
4479
- updatePayload = findFirstSuspended(current);
4480
- if (null !== updatePayload) {
4481
- workInProgress.flags |= 128;
4482
- cutOffTailIfNeeded(type, !1);
4483
- current = updatePayload.updateQueue;
4484
- null !== current &&
4485
- ((workInProgress.updateQueue = current),
4486
- (workInProgress.flags |= 4));
4487
- workInProgress.subtreeFlags = 0;
4488
- current = renderLanes;
4489
- for (newProps = workInProgress.child; null !== newProps; )
4490
- (renderLanes = newProps),
4491
- (type = current),
4492
- (renderLanes.flags &= 14680066),
4493
- (updatePayload = renderLanes.alternate),
4494
- null === updatePayload
4495
- ? ((renderLanes.childLanes = 0),
4496
- (renderLanes.lanes = type),
4497
- (renderLanes.child = null),
4498
- (renderLanes.subtreeFlags = 0),
4499
- (renderLanes.memoizedProps = null),
4500
- (renderLanes.memoizedState = null),
4501
- (renderLanes.updateQueue = null),
4502
- (renderLanes.dependencies = null),
4503
- (renderLanes.stateNode = null))
4504
- : ((renderLanes.childLanes = updatePayload.childLanes),
4505
- (renderLanes.lanes = updatePayload.lanes),
4506
- (renderLanes.child = updatePayload.child),
4507
- (renderLanes.subtreeFlags = 0),
4508
- (renderLanes.deletions = null),
4509
- (renderLanes.memoizedProps =
4510
- updatePayload.memoizedProps),
4511
- (renderLanes.memoizedState =
4512
- updatePayload.memoizedState),
4513
- (renderLanes.updateQueue = updatePayload.updateQueue),
4514
- (renderLanes.type = updatePayload.type),
4515
- (type = updatePayload.dependencies),
4516
- (renderLanes.dependencies =
4517
- null === type
4518
- ? null
4519
- : {
4520
- lanes: type.lanes,
4521
- firstContext: type.firstContext
4522
- })),
4523
- (newProps = newProps.sibling);
4524
- push(
4525
- suspenseStackCursor,
4526
- (suspenseStackCursor.current & 1) | 2
4527
- );
4528
- return workInProgress.child;
4529
- }
4530
- current = current.sibling;
4531
- }
4532
- null !== type.tail &&
4533
- now() > workInProgressRootRenderTargetTime &&
4534
- ((workInProgress.flags |= 128),
4535
- (newProps = !0),
4536
- cutOffTailIfNeeded(type, !1),
4537
- (workInProgress.lanes = 4194304));
4538
- }
4539
- else {
4540
- if (!newProps)
4541
- if (
4542
- ((current = findFirstSuspended(updatePayload)), null !== current)
4543
- ) {
4544
- if (
4545
- ((workInProgress.flags |= 128),
4546
- (newProps = !0),
4547
- (current = current.updateQueue),
4548
- null !== current &&
4549
- ((workInProgress.updateQueue = current),
4550
- (workInProgress.flags |= 4)),
4551
- cutOffTailIfNeeded(type, !0),
4552
- null === type.tail &&
4553
- "hidden" === type.tailMode &&
4554
- !updatePayload.alternate)
4555
- )
4556
- return bubbleProperties(workInProgress), null;
4557
- } else
4558
- 2 * now() - type.renderingStartTime >
4559
- workInProgressRootRenderTargetTime &&
4560
- 1073741824 !== renderLanes &&
4561
- ((workInProgress.flags |= 128),
4562
- (newProps = !0),
4563
- cutOffTailIfNeeded(type, !1),
4564
- (workInProgress.lanes = 4194304));
4565
- type.isBackwards
4566
- ? ((updatePayload.sibling = workInProgress.child),
4567
- (workInProgress.child = updatePayload))
4568
- : ((current = type.last),
4569
- null !== current
4570
- ? (current.sibling = updatePayload)
4571
- : (workInProgress.child = updatePayload),
4572
- (type.last = updatePayload));
4573
- }
4574
- if (null !== type.tail)
4575
- return (
4576
- (workInProgress = type.tail),
4577
- (type.rendering = workInProgress),
4578
- (type.tail = workInProgress.sibling),
4579
- (type.renderingStartTime = now()),
4580
- (workInProgress.sibling = null),
4581
- (current = suspenseStackCursor.current),
4582
- push(suspenseStackCursor, newProps ? (current & 1) | 2 : current & 1),
4583
- workInProgress
4584
- );
4585
- bubbleProperties(workInProgress);
4586
- return null;
4587
- case 22:
4588
- case 23:
4589
- return (
4590
- popRenderLanes(),
4591
- (newProps = null !== workInProgress.memoizedState),
4592
- null !== current &&
4593
- (null !== current.memoizedState) !== newProps &&
4594
- (workInProgress.flags |= 8192),
4595
- newProps && 0 !== (workInProgress.mode & 1)
4596
- ? 0 !== (subtreeRenderLanes & 1073741824) &&
4597
- (bubbleProperties(workInProgress),
4598
- workInProgress.subtreeFlags & 6 && (workInProgress.flags |= 8192))
4599
- : bubbleProperties(workInProgress),
4600
- null
4601
- );
4602
- case 24:
4603
- return null;
4604
- case 25:
4605
- return null;
4606
- }
4607
- throw Error(
4608
- "Unknown unit of work tag (" +
4609
- workInProgress.tag +
4610
- "). This error is likely caused by a bug in React. Please file an issue."
4611
- );
4612
- }
4613
- var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner,
4614
- didReceiveUpdate = !1;
4615
- function reconcileChildren(current, workInProgress, nextChildren, renderLanes) {
4616
- workInProgress.child =
4617
- null === current
4618
- ? mountChildFibers(workInProgress, null, nextChildren, renderLanes)
4619
- : reconcileChildFibers(
4620
- workInProgress,
4621
- current.child,
4622
- nextChildren,
4623
- renderLanes
4624
- );
4625
- }
4626
- function updateForwardRef(
4627
- current,
4628
- workInProgress,
4629
- Component,
4630
- nextProps,
4631
- renderLanes
4632
- ) {
4633
- Component = Component.render;
4634
- var ref = workInProgress.ref;
4635
- prepareToReadContext(workInProgress, renderLanes);
4636
- nextProps = renderWithHooks(
4637
- current,
4638
- workInProgress,
4639
- Component,
4640
- nextProps,
4641
- ref,
4642
- renderLanes
4643
- );
4644
- if (null !== current && !didReceiveUpdate)
4645
- return (
4646
- (workInProgress.updateQueue = current.updateQueue),
4647
- (workInProgress.flags &= -2053),
4648
- (current.lanes &= ~renderLanes),
4649
- bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes)
4650
- );
4651
- workInProgress.flags |= 1;
4652
- reconcileChildren(current, workInProgress, nextProps, renderLanes);
4653
- return workInProgress.child;
4654
- }
4655
- function updateMemoComponent(
4656
- current,
4657
- workInProgress,
4658
- Component,
4659
- nextProps,
4660
- renderLanes
4661
- ) {
4662
- if (null === current) {
4663
- var type = Component.type;
4664
- if (
4665
- "function" === typeof type &&
4666
- !shouldConstruct(type) &&
4667
- void 0 === type.defaultProps &&
4668
- null === Component.compare &&
4669
- void 0 === Component.defaultProps
4670
- )
4671
- return (
4672
- (workInProgress.tag = 15),
4673
- (workInProgress.type = type),
4674
- updateSimpleMemoComponent(
4675
- current,
4676
- workInProgress,
4677
- type,
4678
- nextProps,
4321
+ nextProps,
4679
4322
  renderLanes
4680
4323
  )
4681
4324
  );
@@ -4712,18 +4355,24 @@ function updateSimpleMemoComponent(
4712
4355
  nextProps,
4713
4356
  renderLanes
4714
4357
  ) {
4715
- if (
4716
- null !== current &&
4717
- shallowEqual(current.memoizedProps, nextProps) &&
4718
- current.ref === workInProgress.ref
4719
- )
4720
- if (((didReceiveUpdate = !1), 0 !== (current.lanes & renderLanes)))
4721
- 0 !== (current.flags & 131072) && (didReceiveUpdate = !0);
4722
- else
4723
- return (
4724
- (workInProgress.lanes = current.lanes),
4725
- bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes)
4726
- );
4358
+ if (null !== current) {
4359
+ var prevProps = current.memoizedProps;
4360
+ if (
4361
+ shallowEqual(prevProps, nextProps) &&
4362
+ current.ref === workInProgress.ref
4363
+ )
4364
+ if (
4365
+ ((didReceiveUpdate = !1),
4366
+ (workInProgress.pendingProps = nextProps = prevProps),
4367
+ 0 !== (current.lanes & renderLanes))
4368
+ )
4369
+ 0 !== (current.flags & 131072) && (didReceiveUpdate = !0);
4370
+ else
4371
+ return (
4372
+ (workInProgress.lanes = current.lanes),
4373
+ bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes)
4374
+ );
4375
+ }
4727
4376
  return updateFunctionComponent(
4728
4377
  current,
4729
4378
  workInProgress,
@@ -4738,7 +4387,11 @@ function updateOffscreenComponent(current, workInProgress, renderLanes) {
4738
4387
  prevState = null !== current ? current.memoizedState : null;
4739
4388
  if ("hidden" === nextProps.mode)
4740
4389
  if (0 === (workInProgress.mode & 1))
4741
- (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }),
4390
+ (workInProgress.memoizedState = {
4391
+ baseLanes: 0,
4392
+ cachePool: null,
4393
+ transitions: null
4394
+ }),
4742
4395
  push(subtreeRenderLanesCursor, subtreeRenderLanes),
4743
4396
  (subtreeRenderLanes |= renderLanes);
4744
4397
  else {
@@ -4751,14 +4404,19 @@ function updateOffscreenComponent(current, workInProgress, renderLanes) {
4751
4404
  (workInProgress.lanes = workInProgress.childLanes = 1073741824),
4752
4405
  (workInProgress.memoizedState = {
4753
4406
  baseLanes: current,
4754
- cachePool: null
4407
+ cachePool: null,
4408
+ transitions: null
4755
4409
  }),
4756
4410
  (workInProgress.updateQueue = null),
4757
4411
  push(subtreeRenderLanesCursor, subtreeRenderLanes),
4758
4412
  (subtreeRenderLanes |= current),
4759
4413
  null
4760
4414
  );
4761
- workInProgress.memoizedState = { baseLanes: 0, cachePool: null };
4415
+ workInProgress.memoizedState = {
4416
+ baseLanes: 0,
4417
+ cachePool: null,
4418
+ transitions: null
4419
+ };
4762
4420
  nextProps = null !== prevState ? prevState.baseLanes : renderLanes;
4763
4421
  push(subtreeRenderLanesCursor, subtreeRenderLanes);
4764
4422
  subtreeRenderLanes |= nextProps;
@@ -4773,7 +4431,7 @@ function updateOffscreenComponent(current, workInProgress, renderLanes) {
4773
4431
  reconcileChildren(current, workInProgress, nextChildren, renderLanes);
4774
4432
  return workInProgress.child;
4775
4433
  }
4776
- function markRef$1(current, workInProgress) {
4434
+ function markRef(current, workInProgress) {
4777
4435
  var ref = workInProgress.ref;
4778
4436
  if (
4779
4437
  (null === current && null !== ref) ||
@@ -4825,10 +4483,7 @@ function updateClassComponent(
4825
4483
  } else hasContext = !1;
4826
4484
  prepareToReadContext(workInProgress, renderLanes);
4827
4485
  if (null === workInProgress.stateNode)
4828
- null !== current &&
4829
- ((current.alternate = null),
4830
- (workInProgress.alternate = null),
4831
- (workInProgress.flags |= 2)),
4486
+ resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress),
4832
4487
  constructClassInstance(workInProgress, Component, nextProps),
4833
4488
  mountClassInstance(workInProgress, Component, nextProps, renderLanes),
4834
4489
  (nextProps = !0);
@@ -5022,7 +4677,7 @@ function finishClassComponent(
5022
4677
  hasContext,
5023
4678
  renderLanes
5024
4679
  ) {
5025
- markRef$1(current, workInProgress);
4680
+ markRef(current, workInProgress);
5026
4681
  var didCaptureError = 0 !== (workInProgress.flags & 128);
5027
4682
  if (!shouldUpdate && !didCaptureError)
5028
4683
  return (
@@ -5068,14 +4723,15 @@ function pushHostRootContext(workInProgress) {
5068
4723
  }
5069
4724
  var SUSPENDED_MARKER = { dehydrated: null, treeContext: null, retryLane: 0 };
5070
4725
  function mountSuspenseOffscreenState(renderLanes) {
5071
- return { baseLanes: renderLanes, cachePool: null };
4726
+ return { baseLanes: renderLanes, cachePool: null, transitions: null };
5072
4727
  }
5073
4728
  function updateSuspenseComponent(current, workInProgress, renderLanes) {
5074
4729
  var nextProps = workInProgress.pendingProps,
5075
4730
  suspenseContext = suspenseStackCursor.current,
5076
4731
  showFallback = !1,
4732
+ didSuspend = 0 !== (workInProgress.flags & 128),
5077
4733
  JSCompiler_temp;
5078
- (JSCompiler_temp = 0 !== (workInProgress.flags & 128)) ||
4734
+ (JSCompiler_temp = didSuspend) ||
5079
4735
  (JSCompiler_temp =
5080
4736
  null !== current && null === current.memoizedState
5081
4737
  ? !1
@@ -5085,167 +4741,297 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) {
5085
4741
  suspenseContext |= 1;
5086
4742
  push(suspenseStackCursor, suspenseContext & 1);
5087
4743
  if (null === current) {
5088
- suspenseContext = nextProps.children;
5089
- current = nextProps.fallback;
5090
- if (showFallback)
4744
+ current = workInProgress.memoizedState;
4745
+ if (null !== current && null !== current.dehydrated)
5091
4746
  return (
5092
- (showFallback = workInProgress.mode),
5093
- (nextProps = workInProgress.child),
5094
- (suspenseContext = { mode: "hidden", children: suspenseContext }),
5095
- 0 === (showFallback & 1) && null !== nextProps
5096
- ? ((nextProps.childLanes = 0),
5097
- (nextProps.pendingProps = suspenseContext))
5098
- : (nextProps = createFiberFromOffscreen(
5099
- suspenseContext,
5100
- showFallback,
4747
+ 0 === (workInProgress.mode & 1)
4748
+ ? (workInProgress.lanes = 1)
4749
+ : shim()
4750
+ ? (workInProgress.lanes = 8)
4751
+ : (workInProgress.lanes = 1073741824),
4752
+ null
4753
+ );
4754
+ didSuspend = nextProps.children;
4755
+ current = nextProps.fallback;
4756
+ return showFallback
4757
+ ? ((nextProps = workInProgress.mode),
4758
+ (showFallback = workInProgress.child),
4759
+ (didSuspend = { mode: "hidden", children: didSuspend }),
4760
+ 0 === (nextProps & 1) && null !== showFallback
4761
+ ? ((showFallback.childLanes = 0),
4762
+ (showFallback.pendingProps = didSuspend))
4763
+ : (showFallback = createFiberFromOffscreen(
4764
+ didSuspend,
4765
+ nextProps,
5101
4766
  0,
5102
4767
  null
5103
4768
  )),
5104
4769
  (current = createFiberFromFragment(
5105
4770
  current,
5106
- showFallback,
4771
+ nextProps,
5107
4772
  renderLanes,
5108
4773
  null
5109
4774
  )),
5110
- (nextProps.return = workInProgress),
4775
+ (showFallback.return = workInProgress),
5111
4776
  (current.return = workInProgress),
5112
- (nextProps.sibling = current),
5113
- (workInProgress.child = nextProps),
4777
+ (showFallback.sibling = current),
4778
+ (workInProgress.child = showFallback),
5114
4779
  (workInProgress.child.memoizedState = mountSuspenseOffscreenState(
5115
4780
  renderLanes
5116
4781
  )),
5117
4782
  (workInProgress.memoizedState = SUSPENDED_MARKER),
5118
- current
5119
- );
5120
- renderLanes = createFiberFromOffscreen(
5121
- { mode: "visible", children: suspenseContext },
5122
- workInProgress.mode,
5123
- 0,
5124
- null
5125
- );
5126
- renderLanes.return = workInProgress;
5127
- return (workInProgress.child = renderLanes);
4783
+ current)
4784
+ : mountSuspensePrimaryChildren(workInProgress, didSuspend);
5128
4785
  }
5129
- if (null !== current.memoizedState) {
5130
- if (showFallback)
5131
- return (
5132
- (showFallback = updateSuspenseFallbackChildren(
5133
- current,
5134
- workInProgress,
5135
- nextProps.children,
5136
- nextProps.fallback,
5137
- renderLanes
5138
- )),
5139
- (nextProps = workInProgress.child),
5140
- (suspenseContext = current.child.memoizedState),
5141
- (nextProps.memoizedState =
5142
- null === suspenseContext
5143
- ? mountSuspenseOffscreenState(renderLanes)
5144
- : {
5145
- baseLanes: suspenseContext.baseLanes | renderLanes,
5146
- cachePool: null
5147
- }),
5148
- (nextProps.childLanes = current.childLanes & ~renderLanes),
5149
- (workInProgress.memoizedState = SUSPENDED_MARKER),
5150
- showFallback
5151
- );
5152
- renderLanes = updateSuspensePrimaryChildren(
4786
+ suspenseContext = current.memoizedState;
4787
+ if (
4788
+ null !== suspenseContext &&
4789
+ ((JSCompiler_temp = suspenseContext.dehydrated), null !== JSCompiler_temp)
4790
+ )
4791
+ return updateDehydratedSuspenseComponent(
5153
4792
  current,
5154
4793
  workInProgress,
5155
- nextProps.children,
4794
+ didSuspend,
4795
+ nextProps,
4796
+ JSCompiler_temp,
4797
+ suspenseContext,
5156
4798
  renderLanes
5157
4799
  );
5158
- workInProgress.memoizedState = null;
5159
- return renderLanes;
4800
+ if (showFallback) {
4801
+ showFallback = nextProps.fallback;
4802
+ didSuspend = workInProgress.mode;
4803
+ suspenseContext = current.child;
4804
+ JSCompiler_temp = suspenseContext.sibling;
4805
+ var primaryChildProps = { mode: "hidden", children: nextProps.children };
4806
+ 0 === (didSuspend & 1) && workInProgress.child !== suspenseContext
4807
+ ? ((nextProps = workInProgress.child),
4808
+ (nextProps.childLanes = 0),
4809
+ (nextProps.pendingProps = primaryChildProps),
4810
+ (workInProgress.deletions = null))
4811
+ : ((nextProps = createWorkInProgress(suspenseContext, primaryChildProps)),
4812
+ (nextProps.subtreeFlags = suspenseContext.subtreeFlags & 14680064));
4813
+ null !== JSCompiler_temp
4814
+ ? (showFallback = createWorkInProgress(JSCompiler_temp, showFallback))
4815
+ : ((showFallback = createFiberFromFragment(
4816
+ showFallback,
4817
+ didSuspend,
4818
+ renderLanes,
4819
+ null
4820
+ )),
4821
+ (showFallback.flags |= 2));
4822
+ showFallback.return = workInProgress;
4823
+ nextProps.return = workInProgress;
4824
+ nextProps.sibling = showFallback;
4825
+ workInProgress.child = nextProps;
4826
+ nextProps = showFallback;
4827
+ showFallback = workInProgress.child;
4828
+ didSuspend = current.child.memoizedState;
4829
+ didSuspend =
4830
+ null === didSuspend
4831
+ ? mountSuspenseOffscreenState(renderLanes)
4832
+ : {
4833
+ baseLanes: didSuspend.baseLanes | renderLanes,
4834
+ cachePool: null,
4835
+ transitions: didSuspend.transitions
4836
+ };
4837
+ showFallback.memoizedState = didSuspend;
4838
+ showFallback.childLanes = current.childLanes & ~renderLanes;
4839
+ workInProgress.memoizedState = SUSPENDED_MARKER;
4840
+ return nextProps;
5160
4841
  }
5161
- if (showFallback)
5162
- return (
5163
- (showFallback = updateSuspenseFallbackChildren(
5164
- current,
5165
- workInProgress,
5166
- nextProps.children,
5167
- nextProps.fallback,
5168
- renderLanes
5169
- )),
5170
- (nextProps = workInProgress.child),
5171
- (suspenseContext = current.child.memoizedState),
5172
- (nextProps.memoizedState =
5173
- null === suspenseContext
5174
- ? mountSuspenseOffscreenState(renderLanes)
5175
- : {
5176
- baseLanes: suspenseContext.baseLanes | renderLanes,
5177
- cachePool: null
5178
- }),
5179
- (nextProps.childLanes = current.childLanes & ~renderLanes),
5180
- (workInProgress.memoizedState = SUSPENDED_MARKER),
5181
- showFallback
5182
- );
5183
- renderLanes = updateSuspensePrimaryChildren(
5184
- current,
5185
- workInProgress,
5186
- nextProps.children,
5187
- renderLanes
5188
- );
5189
- workInProgress.memoizedState = null;
5190
- return renderLanes;
5191
- }
5192
- function updateSuspensePrimaryChildren(
5193
- current,
5194
- workInProgress,
5195
- primaryChildren,
5196
- renderLanes
5197
- ) {
5198
- var currentPrimaryChildFragment = current.child;
5199
- current = currentPrimaryChildFragment.sibling;
5200
- primaryChildren = createWorkInProgress(currentPrimaryChildFragment, {
4842
+ showFallback = current.child;
4843
+ current = showFallback.sibling;
4844
+ nextProps = createWorkInProgress(showFallback, {
5201
4845
  mode: "visible",
5202
- children: primaryChildren
4846
+ children: nextProps.children
5203
4847
  });
5204
- 0 === (workInProgress.mode & 1) && (primaryChildren.lanes = renderLanes);
5205
- primaryChildren.return = workInProgress;
5206
- primaryChildren.sibling = null;
4848
+ 0 === (workInProgress.mode & 1) && (nextProps.lanes = renderLanes);
4849
+ nextProps.return = workInProgress;
4850
+ nextProps.sibling = null;
5207
4851
  null !== current &&
5208
4852
  ((renderLanes = workInProgress.deletions),
5209
4853
  null === renderLanes
5210
4854
  ? ((workInProgress.deletions = [current]), (workInProgress.flags |= 16))
5211
4855
  : renderLanes.push(current));
4856
+ workInProgress.child = nextProps;
4857
+ workInProgress.memoizedState = null;
4858
+ return nextProps;
4859
+ }
4860
+ function mountSuspensePrimaryChildren(workInProgress, primaryChildren) {
4861
+ primaryChildren = createFiberFromOffscreen(
4862
+ { mode: "visible", children: primaryChildren },
4863
+ workInProgress.mode,
4864
+ 0,
4865
+ null
4866
+ );
4867
+ primaryChildren.return = workInProgress;
5212
4868
  return (workInProgress.child = primaryChildren);
5213
4869
  }
5214
- function updateSuspenseFallbackChildren(
4870
+ function retrySuspenseComponentWithoutHydrating(
5215
4871
  current,
5216
4872
  workInProgress,
5217
- primaryChildren,
5218
- fallbackChildren,
4873
+ renderLanes,
4874
+ recoverableError
4875
+ ) {
4876
+ null !== recoverableError &&
4877
+ (null === hydrationErrors
4878
+ ? (hydrationErrors = [recoverableError])
4879
+ : hydrationErrors.push(recoverableError));
4880
+ reconcileChildFibers(workInProgress, current.child, null, renderLanes);
4881
+ current = mountSuspensePrimaryChildren(
4882
+ workInProgress,
4883
+ workInProgress.pendingProps.children
4884
+ );
4885
+ current.flags |= 2;
4886
+ workInProgress.memoizedState = null;
4887
+ return current;
4888
+ }
4889
+ function updateDehydratedSuspenseComponent(
4890
+ current,
4891
+ workInProgress,
4892
+ didSuspend,
4893
+ nextProps,
4894
+ suspenseInstance,
4895
+ suspenseState,
5219
4896
  renderLanes
5220
4897
  ) {
5221
- var mode = workInProgress.mode;
5222
- current = current.child;
5223
- var currentFallbackChildFragment = current.sibling,
5224
- primaryChildProps = { mode: "hidden", children: primaryChildren };
5225
- 0 === (mode & 1) && workInProgress.child !== current
5226
- ? ((primaryChildren = workInProgress.child),
5227
- (primaryChildren.childLanes = 0),
5228
- (primaryChildren.pendingProps = primaryChildProps),
5229
- (workInProgress.deletions = null))
5230
- : ((primaryChildren = createWorkInProgress(current, primaryChildProps)),
5231
- (primaryChildren.subtreeFlags = current.subtreeFlags & 14680064));
5232
- null !== currentFallbackChildFragment
5233
- ? (fallbackChildren = createWorkInProgress(
5234
- currentFallbackChildFragment,
5235
- fallbackChildren
5236
- ))
5237
- : ((fallbackChildren = createFiberFromFragment(
5238
- fallbackChildren,
5239
- mode,
5240
- renderLanes,
4898
+ if (didSuspend) {
4899
+ if (workInProgress.flags & 256)
4900
+ return (
4901
+ (workInProgress.flags &= -257),
4902
+ retrySuspenseComponentWithoutHydrating(
4903
+ current,
4904
+ workInProgress,
4905
+ renderLanes,
4906
+ Error(
4907
+ "There was an error while hydrating this Suspense boundary. Switched to client rendering."
4908
+ )
4909
+ )
4910
+ );
4911
+ if (null !== workInProgress.memoizedState)
4912
+ return (
4913
+ (workInProgress.child = current.child),
4914
+ (workInProgress.flags |= 128),
5241
4915
  null
5242
- )),
5243
- (fallbackChildren.flags |= 2));
5244
- fallbackChildren.return = workInProgress;
5245
- primaryChildren.return = workInProgress;
5246
- primaryChildren.sibling = fallbackChildren;
5247
- workInProgress.child = primaryChildren;
5248
- return fallbackChildren;
4916
+ );
4917
+ suspenseState = nextProps.fallback;
4918
+ didSuspend = workInProgress.mode;
4919
+ nextProps = createFiberFromOffscreen(
4920
+ { mode: "visible", children: nextProps.children },
4921
+ didSuspend,
4922
+ 0,
4923
+ null
4924
+ );
4925
+ suspenseState = createFiberFromFragment(
4926
+ suspenseState,
4927
+ didSuspend,
4928
+ renderLanes,
4929
+ null
4930
+ );
4931
+ suspenseState.flags |= 2;
4932
+ nextProps.return = workInProgress;
4933
+ suspenseState.return = workInProgress;
4934
+ nextProps.sibling = suspenseState;
4935
+ workInProgress.child = nextProps;
4936
+ 0 !== (workInProgress.mode & 1) &&
4937
+ reconcileChildFibers(workInProgress, current.child, null, renderLanes);
4938
+ workInProgress.child.memoizedState = mountSuspenseOffscreenState(
4939
+ renderLanes
4940
+ );
4941
+ workInProgress.memoizedState = SUSPENDED_MARKER;
4942
+ return suspenseState;
4943
+ }
4944
+ if (0 === (workInProgress.mode & 1))
4945
+ return retrySuspenseComponentWithoutHydrating(
4946
+ current,
4947
+ workInProgress,
4948
+ renderLanes,
4949
+ null
4950
+ );
4951
+ if (shim())
4952
+ return (
4953
+ (suspenseState = shim().errorMessage),
4954
+ retrySuspenseComponentWithoutHydrating(
4955
+ current,
4956
+ workInProgress,
4957
+ renderLanes,
4958
+ suspenseState
4959
+ ? Error(suspenseState)
4960
+ : Error(
4961
+ "The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering."
4962
+ )
4963
+ )
4964
+ );
4965
+ didSuspend = 0 !== (renderLanes & current.childLanes);
4966
+ if (didReceiveUpdate || didSuspend) {
4967
+ nextProps = workInProgressRoot;
4968
+ if (null !== nextProps) {
4969
+ switch (renderLanes & -renderLanes) {
4970
+ case 4:
4971
+ didSuspend = 2;
4972
+ break;
4973
+ case 16:
4974
+ didSuspend = 8;
4975
+ break;
4976
+ case 64:
4977
+ case 128:
4978
+ case 256:
4979
+ case 512:
4980
+ case 1024:
4981
+ case 2048:
4982
+ case 4096:
4983
+ case 8192:
4984
+ case 16384:
4985
+ case 32768:
4986
+ case 65536:
4987
+ case 131072:
4988
+ case 262144:
4989
+ case 524288:
4990
+ case 1048576:
4991
+ case 2097152:
4992
+ case 4194304:
4993
+ case 8388608:
4994
+ case 16777216:
4995
+ case 33554432:
4996
+ case 67108864:
4997
+ didSuspend = 32;
4998
+ break;
4999
+ case 536870912:
5000
+ didSuspend = 268435456;
5001
+ break;
5002
+ default:
5003
+ didSuspend = 0;
5004
+ }
5005
+ nextProps =
5006
+ 0 !== (didSuspend & (nextProps.suspendedLanes | renderLanes))
5007
+ ? 0
5008
+ : didSuspend;
5009
+ 0 !== nextProps &&
5010
+ nextProps !== suspenseState.retryLane &&
5011
+ ((suspenseState.retryLane = nextProps),
5012
+ scheduleUpdateOnFiber(current, nextProps, -1));
5013
+ }
5014
+ renderDidSuspendDelayIfPossible();
5015
+ return retrySuspenseComponentWithoutHydrating(
5016
+ current,
5017
+ workInProgress,
5018
+ renderLanes,
5019
+ Error(
5020
+ "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."
5021
+ )
5022
+ );
5023
+ }
5024
+ if (shim())
5025
+ return (
5026
+ (workInProgress.flags |= 128),
5027
+ (workInProgress.child = current.child),
5028
+ retryDehydratedSuspenseBoundary.bind(null, current),
5029
+ shim(),
5030
+ null
5031
+ );
5032
+ current = mountSuspensePrimaryChildren(workInProgress, nextProps.children);
5033
+ current.flags |= 4096;
5034
+ return current;
5249
5035
  }
5250
5036
  function scheduleSuspenseWorkOnFiber(fiber, renderLanes, propagationRoot) {
5251
5037
  fiber.lanes |= renderLanes;
@@ -5364,6 +5150,13 @@ function updateSuspenseListComponent(current, workInProgress, renderLanes) {
5364
5150
  }
5365
5151
  return workInProgress.child;
5366
5152
  }
5153
+ function resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress) {
5154
+ 0 === (workInProgress.mode & 1) &&
5155
+ null !== current &&
5156
+ ((current.alternate = null),
5157
+ (workInProgress.alternate = null),
5158
+ (workInProgress.flags |= 2));
5159
+ }
5367
5160
  function bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) {
5368
5161
  null !== current && (workInProgress.dependencies = current.dependencies);
5369
5162
  workInProgressRootSkippedLanes |= workInProgress.lanes;
@@ -5411,7 +5204,14 @@ function attemptEarlyBailoutIfNoScheduledUpdate(
5411
5204
  context._currentValue = nextValue;
5412
5205
  break;
5413
5206
  case 13:
5414
- if (null !== workInProgress.memoizedState) {
5207
+ context = workInProgress.memoizedState;
5208
+ if (null !== context) {
5209
+ if (null !== context.dehydrated)
5210
+ return (
5211
+ push(suspenseStackCursor, suspenseStackCursor.current & 1),
5212
+ (workInProgress.flags |= 128),
5213
+ null
5214
+ );
5415
5215
  if (0 !== (renderLanes & workInProgress.child.childLanes))
5416
5216
  return updateSuspenseComponent(current, workInProgress, renderLanes);
5417
5217
  push(suspenseStackCursor, suspenseStackCursor.current & 1);
@@ -5435,22 +5235,432 @@ function attemptEarlyBailoutIfNoScheduledUpdate(
5435
5235
  );
5436
5236
  workInProgress.flags |= 128;
5437
5237
  }
5438
- nextValue = workInProgress.memoizedState;
5439
- null !== nextValue &&
5440
- ((nextValue.rendering = null),
5441
- (nextValue.tail = null),
5442
- (nextValue.lastEffect = null));
5443
- push(suspenseStackCursor, suspenseStackCursor.current);
5444
- if (context) break;
5445
- else return null;
5238
+ nextValue = workInProgress.memoizedState;
5239
+ null !== nextValue &&
5240
+ ((nextValue.rendering = null),
5241
+ (nextValue.tail = null),
5242
+ (nextValue.lastEffect = null));
5243
+ push(suspenseStackCursor, suspenseStackCursor.current);
5244
+ if (context) break;
5245
+ else return null;
5246
+ case 22:
5247
+ case 23:
5248
+ return (
5249
+ (workInProgress.lanes = 0),
5250
+ updateOffscreenComponent(current, workInProgress, renderLanes)
5251
+ );
5252
+ }
5253
+ return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes);
5254
+ }
5255
+ var appendAllChildren,
5256
+ updateHostContainer,
5257
+ updateHostComponent$1,
5258
+ updateHostText$1;
5259
+ appendAllChildren = function(parent, workInProgress) {
5260
+ for (var node = workInProgress.child; null !== node; ) {
5261
+ if (5 === node.tag || 6 === node.tag) parent._children.push(node.stateNode);
5262
+ else if (4 !== node.tag && null !== node.child) {
5263
+ node.child.return = node;
5264
+ node = node.child;
5265
+ continue;
5266
+ }
5267
+ if (node === workInProgress) break;
5268
+ for (; null === node.sibling; ) {
5269
+ if (null === node.return || node.return === workInProgress) return;
5270
+ node = node.return;
5271
+ }
5272
+ node.sibling.return = node.return;
5273
+ node = node.sibling;
5274
+ }
5275
+ };
5276
+ updateHostContainer = function() {};
5277
+ updateHostComponent$1 = function(current, workInProgress, type, newProps) {
5278
+ current.memoizedProps !== newProps &&
5279
+ (requiredContext(contextStackCursor$1.current),
5280
+ (workInProgress.updateQueue = UPDATE_SIGNAL)) &&
5281
+ (workInProgress.flags |= 4);
5282
+ };
5283
+ updateHostText$1 = function(current, workInProgress, oldText, newText) {
5284
+ oldText !== newText && (workInProgress.flags |= 4);
5285
+ };
5286
+ function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) {
5287
+ switch (renderState.tailMode) {
5288
+ case "hidden":
5289
+ hasRenderedATailFallback = renderState.tail;
5290
+ for (var lastTailNode = null; null !== hasRenderedATailFallback; )
5291
+ null !== hasRenderedATailFallback.alternate &&
5292
+ (lastTailNode = hasRenderedATailFallback),
5293
+ (hasRenderedATailFallback = hasRenderedATailFallback.sibling);
5294
+ null === lastTailNode
5295
+ ? (renderState.tail = null)
5296
+ : (lastTailNode.sibling = null);
5297
+ break;
5298
+ case "collapsed":
5299
+ lastTailNode = renderState.tail;
5300
+ for (var lastTailNode$60 = null; null !== lastTailNode; )
5301
+ null !== lastTailNode.alternate && (lastTailNode$60 = lastTailNode),
5302
+ (lastTailNode = lastTailNode.sibling);
5303
+ null === lastTailNode$60
5304
+ ? hasRenderedATailFallback || null === renderState.tail
5305
+ ? (renderState.tail = null)
5306
+ : (renderState.tail.sibling = null)
5307
+ : (lastTailNode$60.sibling = null);
5308
+ }
5309
+ }
5310
+ function bubbleProperties(completedWork) {
5311
+ var didBailout =
5312
+ null !== completedWork.alternate &&
5313
+ completedWork.alternate.child === completedWork.child,
5314
+ newChildLanes = 0,
5315
+ subtreeFlags = 0;
5316
+ if (didBailout)
5317
+ for (var child$61 = completedWork.child; null !== child$61; )
5318
+ (newChildLanes |= child$61.lanes | child$61.childLanes),
5319
+ (subtreeFlags |= child$61.subtreeFlags & 14680064),
5320
+ (subtreeFlags |= child$61.flags & 14680064),
5321
+ (child$61.return = completedWork),
5322
+ (child$61 = child$61.sibling);
5323
+ else
5324
+ for (child$61 = completedWork.child; null !== child$61; )
5325
+ (newChildLanes |= child$61.lanes | child$61.childLanes),
5326
+ (subtreeFlags |= child$61.subtreeFlags),
5327
+ (subtreeFlags |= child$61.flags),
5328
+ (child$61.return = completedWork),
5329
+ (child$61 = child$61.sibling);
5330
+ completedWork.subtreeFlags |= subtreeFlags;
5331
+ completedWork.childLanes = newChildLanes;
5332
+ return didBailout;
5333
+ }
5334
+ function completeWork(current, workInProgress, renderLanes) {
5335
+ var newProps = workInProgress.pendingProps;
5336
+ popTreeContext(workInProgress);
5337
+ switch (workInProgress.tag) {
5338
+ case 2:
5339
+ case 16:
5340
+ case 15:
5341
+ case 0:
5342
+ case 11:
5343
+ case 7:
5344
+ case 8:
5345
+ case 12:
5346
+ case 9:
5347
+ case 14:
5348
+ return bubbleProperties(workInProgress), null;
5349
+ case 1:
5350
+ return (
5351
+ isContextProvider(workInProgress.type) && popContext(),
5352
+ bubbleProperties(workInProgress),
5353
+ null
5354
+ );
5355
+ case 3:
5356
+ return (
5357
+ (renderLanes = workInProgress.stateNode),
5358
+ popHostContainer(),
5359
+ pop(didPerformWorkStackCursor),
5360
+ pop(contextStackCursor),
5361
+ resetWorkInProgressVersions(),
5362
+ renderLanes.pendingContext &&
5363
+ ((renderLanes.context = renderLanes.pendingContext),
5364
+ (renderLanes.pendingContext = null)),
5365
+ (null !== current && null !== current.child) ||
5366
+ null === current ||
5367
+ (current.memoizedState.isDehydrated &&
5368
+ 0 === (workInProgress.flags & 256)) ||
5369
+ ((workInProgress.flags |= 1024),
5370
+ null !== hydrationErrors &&
5371
+ (queueRecoverableErrors(hydrationErrors),
5372
+ (hydrationErrors = null))),
5373
+ updateHostContainer(current, workInProgress),
5374
+ bubbleProperties(workInProgress),
5375
+ null
5376
+ );
5377
+ case 5:
5378
+ popHostContext(workInProgress);
5379
+ renderLanes = requiredContext(rootInstanceStackCursor.current);
5380
+ var type = workInProgress.type;
5381
+ if (null !== current && null != workInProgress.stateNode)
5382
+ updateHostComponent$1(
5383
+ current,
5384
+ workInProgress,
5385
+ type,
5386
+ newProps,
5387
+ renderLanes
5388
+ ),
5389
+ current.ref !== workInProgress.ref && (workInProgress.flags |= 512);
5390
+ else {
5391
+ if (!newProps) {
5392
+ if (null === workInProgress.stateNode)
5393
+ throw Error(
5394
+ "We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue."
5395
+ );
5396
+ bubbleProperties(workInProgress);
5397
+ return null;
5398
+ }
5399
+ requiredContext(contextStackCursor$1.current);
5400
+ current = allocateTag();
5401
+ type = getViewConfigForType(type);
5402
+ var updatePayload = diffProperties(
5403
+ null,
5404
+ emptyObject,
5405
+ newProps,
5406
+ type.validAttributes
5407
+ );
5408
+ ReactNativePrivateInterface.UIManager.createView(
5409
+ current,
5410
+ type.uiViewClassName,
5411
+ renderLanes,
5412
+ updatePayload
5413
+ );
5414
+ renderLanes = new ReactNativeFiberHostComponent(
5415
+ current,
5416
+ type,
5417
+ workInProgress
5418
+ );
5419
+ instanceCache.set(current, workInProgress);
5420
+ instanceProps.set(current, newProps);
5421
+ appendAllChildren(renderLanes, workInProgress, !1, !1);
5422
+ workInProgress.stateNode = renderLanes;
5423
+ finalizeInitialChildren(renderLanes) && (workInProgress.flags |= 4);
5424
+ null !== workInProgress.ref && (workInProgress.flags |= 512);
5425
+ }
5426
+ bubbleProperties(workInProgress);
5427
+ return null;
5428
+ case 6:
5429
+ if (current && null != workInProgress.stateNode)
5430
+ updateHostText$1(
5431
+ current,
5432
+ workInProgress,
5433
+ current.memoizedProps,
5434
+ newProps
5435
+ );
5436
+ else {
5437
+ if ("string" !== typeof newProps && null === workInProgress.stateNode)
5438
+ throw Error(
5439
+ "We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue."
5440
+ );
5441
+ current = requiredContext(rootInstanceStackCursor.current);
5442
+ if (!requiredContext(contextStackCursor$1.current).isInAParentText)
5443
+ throw Error(
5444
+ "Text strings must be rendered within a <Text> component."
5445
+ );
5446
+ renderLanes = allocateTag();
5447
+ ReactNativePrivateInterface.UIManager.createView(
5448
+ renderLanes,
5449
+ "RCTRawText",
5450
+ current,
5451
+ { text: newProps }
5452
+ );
5453
+ instanceCache.set(renderLanes, workInProgress);
5454
+ workInProgress.stateNode = renderLanes;
5455
+ }
5456
+ bubbleProperties(workInProgress);
5457
+ return null;
5458
+ case 13:
5459
+ pop(suspenseStackCursor);
5460
+ newProps = workInProgress.memoizedState;
5461
+ if (
5462
+ null === current ||
5463
+ (null !== current.memoizedState &&
5464
+ null !== current.memoizedState.dehydrated)
5465
+ ) {
5466
+ if (null !== newProps && null !== newProps.dehydrated) {
5467
+ if (null === current) {
5468
+ throw Error(
5469
+ "A dehydrated suspense component was completed without a hydrated node. This is probably a bug in React."
5470
+ );
5471
+ throw Error(
5472
+ "Expected prepareToHydrateHostSuspenseInstance() to never be called. This error is likely caused by a bug in React. Please file an issue."
5473
+ );
5474
+ }
5475
+ 0 === (workInProgress.flags & 128) &&
5476
+ (workInProgress.memoizedState = null);
5477
+ workInProgress.flags |= 4;
5478
+ bubbleProperties(workInProgress);
5479
+ type = !1;
5480
+ } else
5481
+ null !== hydrationErrors &&
5482
+ (queueRecoverableErrors(hydrationErrors), (hydrationErrors = null)),
5483
+ (type = !0);
5484
+ if (!type) return workInProgress.flags & 65536 ? workInProgress : null;
5485
+ }
5486
+ if (0 !== (workInProgress.flags & 128))
5487
+ return (workInProgress.lanes = renderLanes), workInProgress;
5488
+ renderLanes = null !== newProps;
5489
+ renderLanes !== (null !== current && null !== current.memoizedState) &&
5490
+ renderLanes &&
5491
+ ((workInProgress.child.flags |= 8192),
5492
+ 0 !== (workInProgress.mode & 1) &&
5493
+ (null === current || 0 !== (suspenseStackCursor.current & 1)
5494
+ ? 0 === workInProgressRootExitStatus &&
5495
+ (workInProgressRootExitStatus = 3)
5496
+ : renderDidSuspendDelayIfPossible()));
5497
+ null !== workInProgress.updateQueue && (workInProgress.flags |= 4);
5498
+ bubbleProperties(workInProgress);
5499
+ return null;
5500
+ case 4:
5501
+ return (
5502
+ popHostContainer(),
5503
+ updateHostContainer(current, workInProgress),
5504
+ bubbleProperties(workInProgress),
5505
+ null
5506
+ );
5507
+ case 10:
5508
+ return (
5509
+ popProvider(workInProgress.type._context),
5510
+ bubbleProperties(workInProgress),
5511
+ null
5512
+ );
5513
+ case 17:
5514
+ return (
5515
+ isContextProvider(workInProgress.type) && popContext(),
5516
+ bubbleProperties(workInProgress),
5517
+ null
5518
+ );
5519
+ case 19:
5520
+ pop(suspenseStackCursor);
5521
+ type = workInProgress.memoizedState;
5522
+ if (null === type) return bubbleProperties(workInProgress), null;
5523
+ newProps = 0 !== (workInProgress.flags & 128);
5524
+ updatePayload = type.rendering;
5525
+ if (null === updatePayload)
5526
+ if (newProps) cutOffTailIfNeeded(type, !1);
5527
+ else {
5528
+ if (
5529
+ 0 !== workInProgressRootExitStatus ||
5530
+ (null !== current && 0 !== (current.flags & 128))
5531
+ )
5532
+ for (current = workInProgress.child; null !== current; ) {
5533
+ updatePayload = findFirstSuspended(current);
5534
+ if (null !== updatePayload) {
5535
+ workInProgress.flags |= 128;
5536
+ cutOffTailIfNeeded(type, !1);
5537
+ current = updatePayload.updateQueue;
5538
+ null !== current &&
5539
+ ((workInProgress.updateQueue = current),
5540
+ (workInProgress.flags |= 4));
5541
+ workInProgress.subtreeFlags = 0;
5542
+ current = renderLanes;
5543
+ for (renderLanes = workInProgress.child; null !== renderLanes; )
5544
+ (newProps = renderLanes),
5545
+ (type = current),
5546
+ (newProps.flags &= 14680066),
5547
+ (updatePayload = newProps.alternate),
5548
+ null === updatePayload
5549
+ ? ((newProps.childLanes = 0),
5550
+ (newProps.lanes = type),
5551
+ (newProps.child = null),
5552
+ (newProps.subtreeFlags = 0),
5553
+ (newProps.memoizedProps = null),
5554
+ (newProps.memoizedState = null),
5555
+ (newProps.updateQueue = null),
5556
+ (newProps.dependencies = null),
5557
+ (newProps.stateNode = null))
5558
+ : ((newProps.childLanes = updatePayload.childLanes),
5559
+ (newProps.lanes = updatePayload.lanes),
5560
+ (newProps.child = updatePayload.child),
5561
+ (newProps.subtreeFlags = 0),
5562
+ (newProps.deletions = null),
5563
+ (newProps.memoizedProps = updatePayload.memoizedProps),
5564
+ (newProps.memoizedState = updatePayload.memoizedState),
5565
+ (newProps.updateQueue = updatePayload.updateQueue),
5566
+ (newProps.type = updatePayload.type),
5567
+ (type = updatePayload.dependencies),
5568
+ (newProps.dependencies =
5569
+ null === type
5570
+ ? null
5571
+ : {
5572
+ lanes: type.lanes,
5573
+ firstContext: type.firstContext
5574
+ })),
5575
+ (renderLanes = renderLanes.sibling);
5576
+ push(
5577
+ suspenseStackCursor,
5578
+ (suspenseStackCursor.current & 1) | 2
5579
+ );
5580
+ return workInProgress.child;
5581
+ }
5582
+ current = current.sibling;
5583
+ }
5584
+ null !== type.tail &&
5585
+ now() > workInProgressRootRenderTargetTime &&
5586
+ ((workInProgress.flags |= 128),
5587
+ (newProps = !0),
5588
+ cutOffTailIfNeeded(type, !1),
5589
+ (workInProgress.lanes = 4194304));
5590
+ }
5591
+ else {
5592
+ if (!newProps)
5593
+ if (
5594
+ ((current = findFirstSuspended(updatePayload)), null !== current)
5595
+ ) {
5596
+ if (
5597
+ ((workInProgress.flags |= 128),
5598
+ (newProps = !0),
5599
+ (current = current.updateQueue),
5600
+ null !== current &&
5601
+ ((workInProgress.updateQueue = current),
5602
+ (workInProgress.flags |= 4)),
5603
+ cutOffTailIfNeeded(type, !0),
5604
+ null === type.tail &&
5605
+ "hidden" === type.tailMode &&
5606
+ !updatePayload.alternate)
5607
+ )
5608
+ return bubbleProperties(workInProgress), null;
5609
+ } else
5610
+ 2 * now() - type.renderingStartTime >
5611
+ workInProgressRootRenderTargetTime &&
5612
+ 1073741824 !== renderLanes &&
5613
+ ((workInProgress.flags |= 128),
5614
+ (newProps = !0),
5615
+ cutOffTailIfNeeded(type, !1),
5616
+ (workInProgress.lanes = 4194304));
5617
+ type.isBackwards
5618
+ ? ((updatePayload.sibling = workInProgress.child),
5619
+ (workInProgress.child = updatePayload))
5620
+ : ((current = type.last),
5621
+ null !== current
5622
+ ? (current.sibling = updatePayload)
5623
+ : (workInProgress.child = updatePayload),
5624
+ (type.last = updatePayload));
5625
+ }
5626
+ if (null !== type.tail)
5627
+ return (
5628
+ (workInProgress = type.tail),
5629
+ (type.rendering = workInProgress),
5630
+ (type.tail = workInProgress.sibling),
5631
+ (type.renderingStartTime = now()),
5632
+ (workInProgress.sibling = null),
5633
+ (current = suspenseStackCursor.current),
5634
+ push(suspenseStackCursor, newProps ? (current & 1) | 2 : current & 1),
5635
+ workInProgress
5636
+ );
5637
+ bubbleProperties(workInProgress);
5638
+ return null;
5446
5639
  case 22:
5447
5640
  case 23:
5448
5641
  return (
5449
- (workInProgress.lanes = 0),
5450
- updateOffscreenComponent(current, workInProgress, renderLanes)
5642
+ popRenderLanes(),
5643
+ (renderLanes = null !== workInProgress.memoizedState),
5644
+ null !== current &&
5645
+ (null !== current.memoizedState) !== renderLanes &&
5646
+ (workInProgress.flags |= 8192),
5647
+ renderLanes && 0 !== (workInProgress.mode & 1)
5648
+ ? 0 !== (subtreeRenderLanes & 1073741824) &&
5649
+ (bubbleProperties(workInProgress),
5650
+ workInProgress.subtreeFlags & 6 && (workInProgress.flags |= 8192))
5651
+ : bubbleProperties(workInProgress),
5652
+ null
5451
5653
  );
5654
+ case 24:
5655
+ return null;
5656
+ case 25:
5657
+ return null;
5452
5658
  }
5453
- return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes);
5659
+ throw Error(
5660
+ "Unknown unit of work tag (" +
5661
+ workInProgress.tag +
5662
+ "). This error is likely caused by a bug in React. Please file an issue."
5663
+ );
5454
5664
  }
5455
5665
  function unwindWork(current, workInProgress) {
5456
5666
  popTreeContext(workInProgress);
@@ -5477,13 +5687,20 @@ function unwindWork(current, workInProgress) {
5477
5687
  case 5:
5478
5688
  return popHostContext(workInProgress), null;
5479
5689
  case 13:
5480
- return (
5481
- pop(suspenseStackCursor),
5482
- (current = workInProgress.flags),
5483
- current & 65536
5484
- ? ((workInProgress.flags = (current & -65537) | 128), workInProgress)
5485
- : null
5486
- );
5690
+ pop(suspenseStackCursor);
5691
+ current = workInProgress.memoizedState;
5692
+ if (
5693
+ null !== current &&
5694
+ null !== current.dehydrated &&
5695
+ null === workInProgress.alternate
5696
+ )
5697
+ throw Error(
5698
+ "Threw in newly mounted dehydrated component. This is likely a bug in React. Please file an issue."
5699
+ );
5700
+ current = workInProgress.flags;
5701
+ return current & 65536
5702
+ ? ((workInProgress.flags = (current & -65537) | 128), workInProgress)
5703
+ : null;
5487
5704
  case 19:
5488
5705
  return pop(suspenseStackCursor), null;
5489
5706
  case 4:
@@ -5607,61 +5824,13 @@ function commitHookEffectListMount(flags, finishedWork) {
5607
5824
  var effect = (finishedWork = finishedWork.next);
5608
5825
  do {
5609
5826
  if ((effect.tag & flags) === flags) {
5610
- var create$77 = effect.create;
5611
- effect.destroy = create$77();
5827
+ var create$73 = effect.create;
5828
+ effect.destroy = create$73();
5612
5829
  }
5613
5830
  effect = effect.next;
5614
5831
  } while (effect !== finishedWork);
5615
5832
  }
5616
5833
  }
5617
- function commitUnmount(finishedRoot, current, nearestMountedAncestor) {
5618
- if (injectedHook && "function" === typeof injectedHook.onCommitFiberUnmount)
5619
- try {
5620
- injectedHook.onCommitFiberUnmount(rendererID, current);
5621
- } catch (err) {}
5622
- switch (current.tag) {
5623
- case 0:
5624
- case 11:
5625
- case 14:
5626
- case 15:
5627
- finishedRoot = current.updateQueue;
5628
- if (
5629
- null !== finishedRoot &&
5630
- ((finishedRoot = finishedRoot.lastEffect), null !== finishedRoot)
5631
- ) {
5632
- var effect = (finishedRoot = finishedRoot.next);
5633
- do {
5634
- var _effect = effect,
5635
- destroy = _effect.destroy;
5636
- _effect = _effect.tag;
5637
- void 0 !== destroy &&
5638
- (0 !== (_effect & 2)
5639
- ? safelyCallDestroy(current, nearestMountedAncestor, destroy)
5640
- : 0 !== (_effect & 4) &&
5641
- safelyCallDestroy(current, nearestMountedAncestor, destroy));
5642
- effect = effect.next;
5643
- } while (effect !== finishedRoot);
5644
- }
5645
- break;
5646
- case 1:
5647
- safelyDetachRef(current, nearestMountedAncestor);
5648
- finishedRoot = current.stateNode;
5649
- if ("function" === typeof finishedRoot.componentWillUnmount)
5650
- try {
5651
- (finishedRoot.props = current.memoizedProps),
5652
- (finishedRoot.state = current.memoizedState),
5653
- finishedRoot.componentWillUnmount();
5654
- } catch (error) {
5655
- captureCommitPhaseError(current, nearestMountedAncestor, error);
5656
- }
5657
- break;
5658
- case 5:
5659
- safelyDetachRef(current, nearestMountedAncestor);
5660
- break;
5661
- case 4:
5662
- unmountHostComponents(finishedRoot, current, nearestMountedAncestor);
5663
- }
5664
- }
5665
5834
  function detachFiberAfterEffects(fiber) {
5666
5835
  var alternate = fiber.alternate;
5667
5836
  null !== alternate &&
@@ -5700,40 +5869,6 @@ function getHostSibling(fiber) {
5700
5869
  if (!(fiber.flags & 2)) return fiber.stateNode;
5701
5870
  }
5702
5871
  }
5703
- function commitPlacement(finishedWork) {
5704
- a: {
5705
- for (var parent = finishedWork.return; null !== parent; ) {
5706
- if (isHostParent(parent)) break a;
5707
- parent = parent.return;
5708
- }
5709
- throw Error(
5710
- "Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue."
5711
- );
5712
- }
5713
- var parentFiber = parent;
5714
- switch (parentFiber.tag) {
5715
- case 5:
5716
- parent = parentFiber.stateNode;
5717
- parentFiber.flags & 32 && (parentFiber.flags &= -33);
5718
- parentFiber = getHostSibling(finishedWork);
5719
- insertOrAppendPlacementNode(finishedWork, parentFiber, parent);
5720
- break;
5721
- case 3:
5722
- case 4:
5723
- parent = parentFiber.stateNode.containerInfo;
5724
- parentFiber = getHostSibling(finishedWork);
5725
- insertOrAppendPlacementNodeIntoContainer(
5726
- finishedWork,
5727
- parentFiber,
5728
- parent
5729
- );
5730
- break;
5731
- default:
5732
- throw Error(
5733
- "Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue."
5734
- );
5735
- }
5736
- }
5737
5872
  function insertOrAppendPlacementNodeIntoContainer(node, before, parent) {
5738
5873
  var tag = node.tag;
5739
5874
  if (5 === tag || 6 === tag)
@@ -5785,216 +5920,184 @@ function insertOrAppendPlacementNode(node, before, parent) {
5785
5920
  } else
5786
5921
  (before = "number" === typeof node ? node : node._nativeTag),
5787
5922
  (tag = parent._children),
5788
- (index = tag.indexOf(node)),
5789
- 0 <= index
5790
- ? (tag.splice(index, 1),
5791
- tag.push(node),
5792
- ReactNativePrivateInterface.UIManager.manageChildren(
5793
- parent._nativeTag,
5794
- [index],
5795
- [tag.length - 1],
5796
- [],
5797
- [],
5798
- []
5799
- ))
5800
- : (tag.push(node),
5801
- ReactNativePrivateInterface.UIManager.manageChildren(
5802
- parent._nativeTag,
5803
- [],
5804
- [],
5805
- [before],
5806
- [tag.length - 1],
5807
- []
5808
- ));
5809
- else if (4 !== tag && ((node = node.child), null !== node))
5810
- for (
5811
- insertOrAppendPlacementNode(node, before, parent), node = node.sibling;
5812
- null !== node;
5813
-
5814
- )
5815
- insertOrAppendPlacementNode(node, before, parent), (node = node.sibling);
5816
- }
5817
- function unmountHostComponents(
5818
- finishedRoot$jscomp$0,
5819
- current,
5820
- nearestMountedAncestor$jscomp$0
5821
- ) {
5822
- for (
5823
- var node = current,
5824
- currentParentIsValid = !1,
5825
- currentParent,
5826
- currentParentIsContainer;
5827
- ;
5828
-
5829
- ) {
5830
- if (!currentParentIsValid) {
5831
- currentParentIsValid = node.return;
5832
- a: for (;;) {
5833
- if (null === currentParentIsValid)
5834
- throw Error(
5835
- "Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue."
5836
- );
5837
- currentParent = currentParentIsValid.stateNode;
5838
- switch (currentParentIsValid.tag) {
5839
- case 5:
5840
- currentParentIsContainer = !1;
5841
- break a;
5842
- case 3:
5843
- currentParent = currentParent.containerInfo;
5844
- currentParentIsContainer = !0;
5845
- break a;
5846
- case 4:
5847
- currentParent = currentParent.containerInfo;
5848
- currentParentIsContainer = !0;
5849
- break a;
5850
- }
5851
- currentParentIsValid = currentParentIsValid.return;
5852
- }
5853
- currentParentIsValid = !0;
5854
- }
5855
- if (5 === node.tag || 6 === node.tag) {
5856
- a: for (
5857
- var finishedRoot = finishedRoot$jscomp$0,
5858
- root = node,
5859
- nearestMountedAncestor = nearestMountedAncestor$jscomp$0,
5860
- node$jscomp$0 = root;
5861
- ;
5862
-
5863
- )
5864
- if (
5865
- (commitUnmount(finishedRoot, node$jscomp$0, nearestMountedAncestor),
5866
- null !== node$jscomp$0.child && 4 !== node$jscomp$0.tag)
5867
- )
5868
- (node$jscomp$0.child.return = node$jscomp$0),
5869
- (node$jscomp$0 = node$jscomp$0.child);
5870
- else {
5871
- if (node$jscomp$0 === root) break a;
5872
- for (; null === node$jscomp$0.sibling; ) {
5873
- if (null === node$jscomp$0.return || node$jscomp$0.return === root)
5874
- break a;
5875
- node$jscomp$0 = node$jscomp$0.return;
5876
- }
5877
- node$jscomp$0.sibling.return = node$jscomp$0.return;
5878
- node$jscomp$0 = node$jscomp$0.sibling;
5879
- }
5880
- currentParentIsContainer
5881
- ? ((finishedRoot = currentParent),
5882
- recursivelyUncacheFiberNode(node.stateNode),
5883
- ReactNativePrivateInterface.UIManager.manageChildren(
5884
- finishedRoot,
5885
- [],
5886
- [],
5887
- [],
5888
- [],
5889
- [0]
5890
- ))
5891
- : ((finishedRoot = currentParent),
5892
- (nearestMountedAncestor = node.stateNode),
5893
- recursivelyUncacheFiberNode(nearestMountedAncestor),
5894
- (root = finishedRoot._children),
5895
- (nearestMountedAncestor = root.indexOf(nearestMountedAncestor)),
5896
- root.splice(nearestMountedAncestor, 1),
5897
- ReactNativePrivateInterface.UIManager.manageChildren(
5898
- finishedRoot._nativeTag,
5899
- [],
5900
- [],
5901
- [],
5902
- [],
5903
- [nearestMountedAncestor]
5904
- ));
5905
- } else if (4 === node.tag) {
5906
- if (null !== node.child) {
5907
- currentParent = node.stateNode.containerInfo;
5908
- currentParentIsContainer = !0;
5909
- node.child.return = node;
5910
- node = node.child;
5911
- continue;
5912
- }
5913
- } else if (
5914
- (commitUnmount(
5915
- finishedRoot$jscomp$0,
5916
- node,
5917
- nearestMountedAncestor$jscomp$0
5918
- ),
5919
- null !== node.child)
5920
- ) {
5921
- node.child.return = node;
5922
- node = node.child;
5923
- continue;
5924
- }
5925
- if (node === current) break;
5926
- for (; null === node.sibling; ) {
5927
- if (null === node.return || node.return === current) return;
5928
- node = node.return;
5929
- 4 === node.tag && (currentParentIsValid = !1);
5930
- }
5931
- node.sibling.return = node.return;
5932
- node = node.sibling;
5933
- }
5923
+ (index = tag.indexOf(node)),
5924
+ 0 <= index
5925
+ ? (tag.splice(index, 1),
5926
+ tag.push(node),
5927
+ ReactNativePrivateInterface.UIManager.manageChildren(
5928
+ parent._nativeTag,
5929
+ [index],
5930
+ [tag.length - 1],
5931
+ [],
5932
+ [],
5933
+ []
5934
+ ))
5935
+ : (tag.push(node),
5936
+ ReactNativePrivateInterface.UIManager.manageChildren(
5937
+ parent._nativeTag,
5938
+ [],
5939
+ [],
5940
+ [before],
5941
+ [tag.length - 1],
5942
+ []
5943
+ ));
5944
+ else if (4 !== tag && ((node = node.child), null !== node))
5945
+ for (
5946
+ insertOrAppendPlacementNode(node, before, parent), node = node.sibling;
5947
+ null !== node;
5948
+
5949
+ )
5950
+ insertOrAppendPlacementNode(node, before, parent), (node = node.sibling);
5934
5951
  }
5935
- function commitWork(current, finishedWork) {
5936
- switch (finishedWork.tag) {
5952
+ var hostParent = null,
5953
+ hostParentIsContainer = !1;
5954
+ function recursivelyTraverseDeletionEffects(
5955
+ finishedRoot,
5956
+ nearestMountedAncestor,
5957
+ parent
5958
+ ) {
5959
+ for (parent = parent.child; null !== parent; )
5960
+ commitDeletionEffectsOnFiber(finishedRoot, nearestMountedAncestor, parent),
5961
+ (parent = parent.sibling);
5962
+ }
5963
+ function commitDeletionEffectsOnFiber(
5964
+ finishedRoot,
5965
+ nearestMountedAncestor,
5966
+ deletedFiber
5967
+ ) {
5968
+ if (injectedHook && "function" === typeof injectedHook.onCommitFiberUnmount)
5969
+ try {
5970
+ injectedHook.onCommitFiberUnmount(rendererID, deletedFiber);
5971
+ } catch (err) {}
5972
+ switch (deletedFiber.tag) {
5973
+ case 5:
5974
+ safelyDetachRef(deletedFiber, nearestMountedAncestor);
5975
+ case 6:
5976
+ var prevHostParent = hostParent,
5977
+ prevHostParentIsContainer = hostParentIsContainer;
5978
+ hostParent = null;
5979
+ recursivelyTraverseDeletionEffects(
5980
+ finishedRoot,
5981
+ nearestMountedAncestor,
5982
+ deletedFiber
5983
+ );
5984
+ hostParent = prevHostParent;
5985
+ hostParentIsContainer = prevHostParentIsContainer;
5986
+ null !== hostParent &&
5987
+ (hostParentIsContainer
5988
+ ? ((finishedRoot = hostParent),
5989
+ recursivelyUncacheFiberNode(deletedFiber.stateNode),
5990
+ ReactNativePrivateInterface.UIManager.manageChildren(
5991
+ finishedRoot,
5992
+ [],
5993
+ [],
5994
+ [],
5995
+ [],
5996
+ [0]
5997
+ ))
5998
+ : ((finishedRoot = hostParent),
5999
+ (nearestMountedAncestor = deletedFiber.stateNode),
6000
+ recursivelyUncacheFiberNode(nearestMountedAncestor),
6001
+ (deletedFiber = finishedRoot._children),
6002
+ (nearestMountedAncestor = deletedFiber.indexOf(
6003
+ nearestMountedAncestor
6004
+ )),
6005
+ deletedFiber.splice(nearestMountedAncestor, 1),
6006
+ ReactNativePrivateInterface.UIManager.manageChildren(
6007
+ finishedRoot._nativeTag,
6008
+ [],
6009
+ [],
6010
+ [],
6011
+ [],
6012
+ [nearestMountedAncestor]
6013
+ )));
6014
+ break;
6015
+ case 18:
6016
+ null !== hostParent && shim(hostParent, deletedFiber.stateNode);
6017
+ break;
6018
+ case 4:
6019
+ prevHostParent = hostParent;
6020
+ prevHostParentIsContainer = hostParentIsContainer;
6021
+ hostParent = deletedFiber.stateNode.containerInfo;
6022
+ hostParentIsContainer = !0;
6023
+ recursivelyTraverseDeletionEffects(
6024
+ finishedRoot,
6025
+ nearestMountedAncestor,
6026
+ deletedFiber
6027
+ );
6028
+ hostParent = prevHostParent;
6029
+ hostParentIsContainer = prevHostParentIsContainer;
6030
+ break;
5937
6031
  case 0:
5938
6032
  case 11:
5939
6033
  case 14:
5940
6034
  case 15:
5941
- commitHookEffectListUnmount(3, finishedWork, finishedWork.return);
5942
- commitHookEffectListMount(3, finishedWork);
5943
- commitHookEffectListUnmount(5, finishedWork, finishedWork.return);
5944
- return;
5945
- case 1:
5946
- return;
5947
- case 5:
5948
- var instance = finishedWork.stateNode;
5949
- if (null != instance) {
5950
- var newProps = finishedWork.memoizedProps;
5951
- current = null !== current ? current.memoizedProps : newProps;
5952
- var updatePayload = finishedWork.updateQueue;
5953
- finishedWork.updateQueue = null;
5954
- null !== updatePayload &&
5955
- ((finishedWork = instance.viewConfig),
5956
- instanceProps.set(instance._nativeTag, newProps),
5957
- (newProps = diffProperties(
5958
- null,
5959
- current,
5960
- newProps,
5961
- finishedWork.validAttributes
5962
- )),
5963
- null != newProps &&
5964
- ReactNativePrivateInterface.UIManager.updateView(
5965
- instance._nativeTag,
5966
- finishedWork.uiViewClassName,
5967
- newProps
5968
- ));
6035
+ prevHostParent = deletedFiber.updateQueue;
6036
+ if (
6037
+ null !== prevHostParent &&
6038
+ ((prevHostParent = prevHostParent.lastEffect), null !== prevHostParent)
6039
+ ) {
6040
+ prevHostParentIsContainer = prevHostParent = prevHostParent.next;
6041
+ do {
6042
+ var _effect = prevHostParentIsContainer,
6043
+ destroy = _effect.destroy;
6044
+ _effect = _effect.tag;
6045
+ void 0 !== destroy &&
6046
+ (0 !== (_effect & 2)
6047
+ ? safelyCallDestroy(deletedFiber, nearestMountedAncestor, destroy)
6048
+ : 0 !== (_effect & 4) &&
6049
+ safelyCallDestroy(
6050
+ deletedFiber,
6051
+ nearestMountedAncestor,
6052
+ destroy
6053
+ ));
6054
+ prevHostParentIsContainer = prevHostParentIsContainer.next;
6055
+ } while (prevHostParentIsContainer !== prevHostParent);
5969
6056
  }
5970
- return;
5971
- case 6:
5972
- if (null === finishedWork.stateNode)
5973
- throw Error(
5974
- "This should have a text node initialized. This error is likely caused by a bug in React. Please file an issue."
5975
- );
5976
- ReactNativePrivateInterface.UIManager.updateView(
5977
- finishedWork.stateNode,
5978
- "RCTRawText",
5979
- { text: finishedWork.memoizedProps }
6057
+ recursivelyTraverseDeletionEffects(
6058
+ finishedRoot,
6059
+ nearestMountedAncestor,
6060
+ deletedFiber
6061
+ );
6062
+ break;
6063
+ case 1:
6064
+ safelyDetachRef(deletedFiber, nearestMountedAncestor);
6065
+ prevHostParent = deletedFiber.stateNode;
6066
+ if ("function" === typeof prevHostParent.componentWillUnmount)
6067
+ try {
6068
+ (prevHostParent.props = deletedFiber.memoizedProps),
6069
+ (prevHostParent.state = deletedFiber.memoizedState),
6070
+ prevHostParent.componentWillUnmount();
6071
+ } catch (error) {
6072
+ captureCommitPhaseError(deletedFiber, nearestMountedAncestor, error);
6073
+ }
6074
+ recursivelyTraverseDeletionEffects(
6075
+ finishedRoot,
6076
+ nearestMountedAncestor,
6077
+ deletedFiber
6078
+ );
6079
+ break;
6080
+ case 21:
6081
+ recursivelyTraverseDeletionEffects(
6082
+ finishedRoot,
6083
+ nearestMountedAncestor,
6084
+ deletedFiber
6085
+ );
6086
+ break;
6087
+ case 22:
6088
+ recursivelyTraverseDeletionEffects(
6089
+ finishedRoot,
6090
+ nearestMountedAncestor,
6091
+ deletedFiber
6092
+ );
6093
+ break;
6094
+ default:
6095
+ recursivelyTraverseDeletionEffects(
6096
+ finishedRoot,
6097
+ nearestMountedAncestor,
6098
+ deletedFiber
5980
6099
  );
5981
- return;
5982
- case 3:
5983
- return;
5984
- case 12:
5985
- return;
5986
- case 13:
5987
- attachSuspenseRetryListeners(finishedWork);
5988
- return;
5989
- case 19:
5990
- attachSuspenseRetryListeners(finishedWork);
5991
- return;
5992
- case 17:
5993
- return;
5994
6100
  }
5995
- throw Error(
5996
- "This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue."
5997
- );
5998
6101
  }
5999
6102
  function attachSuspenseRetryListeners(finishedWork) {
6000
6103
  var wakeables = finishedWork.updateQueue;
@@ -6010,153 +6113,307 @@ function attachSuspenseRetryListeners(finishedWork) {
6010
6113
  });
6011
6114
  }
6012
6115
  }
6013
- function commitMutationEffects(root, firstChild) {
6014
- for (nextEffect = firstChild; null !== nextEffect; ) {
6015
- firstChild = nextEffect;
6016
- var deletions = firstChild.deletions;
6017
- if (null !== deletions)
6018
- for (var i = 0; i < deletions.length; i++) {
6019
- var childToDelete = deletions[i];
6116
+ function recursivelyTraverseMutationEffects(root$jscomp$0, parentFiber) {
6117
+ var deletions = parentFiber.deletions;
6118
+ if (null !== deletions)
6119
+ for (var i = 0; i < deletions.length; i++) {
6120
+ var childToDelete = deletions[i];
6121
+ try {
6122
+ var root = root$jscomp$0,
6123
+ returnFiber = parentFiber,
6124
+ parent = returnFiber;
6125
+ a: for (; null !== parent; ) {
6126
+ switch (parent.tag) {
6127
+ case 5:
6128
+ hostParent = parent.stateNode;
6129
+ hostParentIsContainer = !1;
6130
+ break a;
6131
+ case 3:
6132
+ hostParent = parent.stateNode.containerInfo;
6133
+ hostParentIsContainer = !0;
6134
+ break a;
6135
+ case 4:
6136
+ hostParent = parent.stateNode.containerInfo;
6137
+ hostParentIsContainer = !0;
6138
+ break a;
6139
+ }
6140
+ parent = parent.return;
6141
+ }
6142
+ if (null === hostParent)
6143
+ throw Error(
6144
+ "Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue."
6145
+ );
6146
+ commitDeletionEffectsOnFiber(root, returnFiber, childToDelete);
6147
+ hostParent = null;
6148
+ hostParentIsContainer = !1;
6149
+ var alternate = childToDelete.alternate;
6150
+ null !== alternate && (alternate.return = null);
6151
+ childToDelete.return = null;
6152
+ } catch (error) {
6153
+ captureCommitPhaseError(childToDelete, parentFiber, error);
6154
+ }
6155
+ }
6156
+ if (parentFiber.subtreeFlags & 12854)
6157
+ for (parentFiber = parentFiber.child; null !== parentFiber; )
6158
+ commitMutationEffectsOnFiber(parentFiber, root$jscomp$0),
6159
+ (parentFiber = parentFiber.sibling);
6160
+ }
6161
+ function commitMutationEffectsOnFiber(finishedWork, root) {
6162
+ var current = finishedWork.alternate,
6163
+ flags = finishedWork.flags;
6164
+ switch (finishedWork.tag) {
6165
+ case 0:
6166
+ case 11:
6167
+ case 14:
6168
+ case 15:
6169
+ recursivelyTraverseMutationEffects(root, finishedWork);
6170
+ commitReconciliationEffects(finishedWork);
6171
+ if (flags & 4) {
6020
6172
  try {
6021
- unmountHostComponents(root, childToDelete, firstChild);
6022
- var alternate = childToDelete.alternate;
6023
- null !== alternate && (alternate.return = null);
6024
- childToDelete.return = null;
6173
+ commitHookEffectListUnmount(3, finishedWork, finishedWork.return),
6174
+ commitHookEffectListMount(3, finishedWork);
6025
6175
  } catch (error) {
6026
- captureCommitPhaseError(childToDelete, firstChild, error);
6176
+ captureCommitPhaseError(finishedWork, finishedWork.return, error);
6027
6177
  }
6028
- }
6029
- deletions = firstChild.child;
6030
- if (0 !== (firstChild.subtreeFlags & 12854) && null !== deletions)
6031
- (deletions.return = firstChild), (nextEffect = deletions);
6032
- else
6033
- for (; null !== nextEffect; ) {
6034
- firstChild = nextEffect;
6035
6178
  try {
6036
- var flags = firstChild.flags;
6037
- if (flags & 512) {
6038
- var current = firstChild.alternate;
6039
- if (null !== current) {
6040
- var currentRef = current.ref;
6041
- null !== currentRef &&
6042
- ("function" === typeof currentRef
6043
- ? currentRef(null)
6044
- : (currentRef.current = null));
6179
+ commitHookEffectListUnmount(5, finishedWork, finishedWork.return);
6180
+ } catch (error$83) {
6181
+ captureCommitPhaseError(finishedWork, finishedWork.return, error$83);
6182
+ }
6183
+ }
6184
+ break;
6185
+ case 1:
6186
+ recursivelyTraverseMutationEffects(root, finishedWork);
6187
+ commitReconciliationEffects(finishedWork);
6188
+ flags & 512 &&
6189
+ null !== current &&
6190
+ safelyDetachRef(current, current.return);
6191
+ break;
6192
+ case 5:
6193
+ recursivelyTraverseMutationEffects(root, finishedWork);
6194
+ commitReconciliationEffects(finishedWork);
6195
+ flags & 512 &&
6196
+ null !== current &&
6197
+ safelyDetachRef(current, current.return);
6198
+ if (flags & 4) {
6199
+ var instance$85 = finishedWork.stateNode;
6200
+ if (null != instance$85) {
6201
+ var newProps = finishedWork.memoizedProps,
6202
+ oldProps = null !== current ? current.memoizedProps : newProps,
6203
+ updatePayload = finishedWork.updateQueue;
6204
+ finishedWork.updateQueue = null;
6205
+ if (null !== updatePayload)
6206
+ try {
6207
+ var viewConfig = instance$85.viewConfig;
6208
+ instanceProps.set(instance$85._nativeTag, newProps);
6209
+ var updatePayload$jscomp$0 = diffProperties(
6210
+ null,
6211
+ oldProps,
6212
+ newProps,
6213
+ viewConfig.validAttributes
6214
+ );
6215
+ null != updatePayload$jscomp$0 &&
6216
+ ReactNativePrivateInterface.UIManager.updateView(
6217
+ instance$85._nativeTag,
6218
+ viewConfig.uiViewClassName,
6219
+ updatePayload$jscomp$0
6220
+ );
6221
+ } catch (error$86) {
6222
+ captureCommitPhaseError(
6223
+ finishedWork,
6224
+ finishedWork.return,
6225
+ error$86
6226
+ );
6045
6227
  }
6046
- }
6047
- if (flags & 8192)
6048
- switch (firstChild.tag) {
6049
- case 13:
6050
- if (null !== firstChild.memoizedState) {
6051
- var current$84 = firstChild.alternate;
6052
- if (null === current$84 || null === current$84.memoizedState)
6053
- globalMostRecentFallbackTime = now();
6054
- }
6055
- break;
6056
- case 22:
6057
- a: {
6058
- deletions = firstChild;
6059
- var isHidden = null !== firstChild.memoizedState;
6060
- i = null;
6061
- for (childToDelete = deletions; ; ) {
6062
- if (5 === childToDelete.tag) {
6063
- if (null === i) {
6064
- i = childToDelete;
6065
- var instance = childToDelete.stateNode;
6066
- if (isHidden) {
6067
- var instance$jscomp$0 = instance,
6068
- viewConfig = instance$jscomp$0.viewConfig;
6069
- var updatePayload = diffProperties(
6070
- null,
6071
- emptyObject,
6072
- { style: { display: "none" } },
6073
- viewConfig.validAttributes
6074
- );
6075
- ReactNativePrivateInterface.UIManager.updateView(
6076
- instance$jscomp$0._nativeTag,
6077
- viewConfig.uiViewClassName,
6078
- updatePayload
6079
- );
6080
- } else {
6081
- var instance$jscomp$1 = childToDelete.stateNode,
6082
- props = childToDelete.memoizedProps,
6083
- viewConfig$jscomp$0 = instance$jscomp$1.viewConfig,
6084
- prevProps = assign({}, props, {
6085
- style: [props.style, { display: "none" }]
6086
- });
6087
- var updatePayload$jscomp$0 = diffProperties(
6088
- null,
6089
- prevProps,
6090
- props,
6091
- viewConfig$jscomp$0.validAttributes
6092
- );
6093
- ReactNativePrivateInterface.UIManager.updateView(
6094
- instance$jscomp$1._nativeTag,
6095
- viewConfig$jscomp$0.uiViewClassName,
6096
- updatePayload$jscomp$0
6097
- );
6098
- }
6099
- }
6100
- } else if (6 === childToDelete.tag) {
6101
- if (null === i) throw Error("Not yet implemented.");
6102
- } else if (
6103
- ((22 !== childToDelete.tag && 23 !== childToDelete.tag) ||
6104
- null === childToDelete.memoizedState ||
6105
- childToDelete === deletions) &&
6106
- null !== childToDelete.child
6107
- ) {
6108
- childToDelete.child.return = childToDelete;
6109
- childToDelete = childToDelete.child;
6110
- continue;
6111
- }
6112
- if (childToDelete === deletions) break;
6113
- for (; null === childToDelete.sibling; ) {
6114
- if (
6115
- null === childToDelete.return ||
6116
- childToDelete.return === deletions
6117
- )
6118
- break a;
6119
- i === childToDelete && (i = null);
6120
- childToDelete = childToDelete.return;
6121
- }
6122
- i === childToDelete && (i = null);
6123
- childToDelete.sibling.return = childToDelete.return;
6124
- childToDelete = childToDelete.sibling;
6125
- }
6228
+ }
6229
+ }
6230
+ break;
6231
+ case 6:
6232
+ recursivelyTraverseMutationEffects(root, finishedWork);
6233
+ commitReconciliationEffects(finishedWork);
6234
+ if (flags & 4) {
6235
+ if (null === finishedWork.stateNode)
6236
+ throw Error(
6237
+ "This should have a text node initialized. This error is likely caused by a bug in React. Please file an issue."
6238
+ );
6239
+ viewConfig = finishedWork.stateNode;
6240
+ updatePayload$jscomp$0 = finishedWork.memoizedProps;
6241
+ try {
6242
+ ReactNativePrivateInterface.UIManager.updateView(
6243
+ viewConfig,
6244
+ "RCTRawText",
6245
+ { text: updatePayload$jscomp$0 }
6246
+ );
6247
+ } catch (error$87) {
6248
+ captureCommitPhaseError(finishedWork, finishedWork.return, error$87);
6249
+ }
6250
+ }
6251
+ break;
6252
+ case 3:
6253
+ recursivelyTraverseMutationEffects(root, finishedWork);
6254
+ commitReconciliationEffects(finishedWork);
6255
+ break;
6256
+ case 4:
6257
+ recursivelyTraverseMutationEffects(root, finishedWork);
6258
+ commitReconciliationEffects(finishedWork);
6259
+ break;
6260
+ case 13:
6261
+ recursivelyTraverseMutationEffects(root, finishedWork);
6262
+ commitReconciliationEffects(finishedWork);
6263
+ viewConfig = finishedWork.child;
6264
+ viewConfig.flags & 8192 &&
6265
+ null !== viewConfig.memoizedState &&
6266
+ (null === viewConfig.alternate ||
6267
+ null === viewConfig.alternate.memoizedState) &&
6268
+ (globalMostRecentFallbackTime = now());
6269
+ flags & 4 && attachSuspenseRetryListeners(finishedWork);
6270
+ break;
6271
+ case 22:
6272
+ recursivelyTraverseMutationEffects(root, finishedWork);
6273
+ commitReconciliationEffects(finishedWork);
6274
+ if (flags & 8192)
6275
+ a: for (
6276
+ viewConfig = null !== finishedWork.memoizedState,
6277
+ updatePayload$jscomp$0 = null,
6278
+ current = finishedWork;
6279
+ ;
6280
+
6281
+ ) {
6282
+ if (5 === current.tag) {
6283
+ if (null === updatePayload$jscomp$0) {
6284
+ updatePayload$jscomp$0 = current;
6285
+ try {
6286
+ if (((instance$85 = current.stateNode), viewConfig))
6287
+ (newProps = instance$85.viewConfig),
6288
+ (oldProps = diffProperties(
6289
+ null,
6290
+ emptyObject,
6291
+ { style: { display: "none" } },
6292
+ newProps.validAttributes
6293
+ )),
6294
+ ReactNativePrivateInterface.UIManager.updateView(
6295
+ instance$85._nativeTag,
6296
+ newProps.uiViewClassName,
6297
+ oldProps
6298
+ );
6299
+ else {
6300
+ updatePayload = current.stateNode;
6301
+ var props = current.memoizedProps,
6302
+ viewConfig$jscomp$0 = updatePayload.viewConfig,
6303
+ prevProps = assign({}, props, {
6304
+ style: [props.style, { display: "none" }]
6305
+ });
6306
+ var updatePayload$jscomp$1 = diffProperties(
6307
+ null,
6308
+ prevProps,
6309
+ props,
6310
+ viewConfig$jscomp$0.validAttributes
6311
+ );
6312
+ ReactNativePrivateInterface.UIManager.updateView(
6313
+ updatePayload._nativeTag,
6314
+ viewConfig$jscomp$0.uiViewClassName,
6315
+ updatePayload$jscomp$1
6316
+ );
6126
6317
  }
6318
+ } catch (error) {
6319
+ captureCommitPhaseError(
6320
+ finishedWork,
6321
+ finishedWork.return,
6322
+ error
6323
+ );
6324
+ }
6127
6325
  }
6128
- switch (flags & 4102) {
6129
- case 2:
6130
- commitPlacement(firstChild);
6131
- firstChild.flags &= -3;
6132
- break;
6133
- case 6:
6134
- commitPlacement(firstChild);
6135
- firstChild.flags &= -3;
6136
- commitWork(firstChild.alternate, firstChild);
6137
- break;
6138
- case 4096:
6139
- firstChild.flags &= -4097;
6140
- break;
6141
- case 4100:
6142
- firstChild.flags &= -4097;
6143
- commitWork(firstChild.alternate, firstChild);
6144
- break;
6145
- case 4:
6146
- commitWork(firstChild.alternate, firstChild);
6326
+ } else if (6 === current.tag) {
6327
+ if (null === updatePayload$jscomp$0)
6328
+ try {
6329
+ throw Error("Not yet implemented.");
6330
+ } catch (error$78) {
6331
+ captureCommitPhaseError(
6332
+ finishedWork,
6333
+ finishedWork.return,
6334
+ error$78
6335
+ );
6336
+ }
6337
+ } else if (
6338
+ ((22 !== current.tag && 23 !== current.tag) ||
6339
+ null === current.memoizedState ||
6340
+ current === finishedWork) &&
6341
+ null !== current.child
6342
+ ) {
6343
+ current.child.return = current;
6344
+ current = current.child;
6345
+ continue;
6147
6346
  }
6148
- } catch (error) {
6149
- captureCommitPhaseError(firstChild, firstChild.return, error);
6347
+ if (current === finishedWork) break a;
6348
+ for (; null === current.sibling; ) {
6349
+ if (null === current.return || current.return === finishedWork)
6350
+ break a;
6351
+ updatePayload$jscomp$0 === current &&
6352
+ (updatePayload$jscomp$0 = null);
6353
+ current = current.return;
6354
+ }
6355
+ updatePayload$jscomp$0 === current && (updatePayload$jscomp$0 = null);
6356
+ current.sibling.return = current.return;
6357
+ current = current.sibling;
6150
6358
  }
6151
- deletions = firstChild.sibling;
6152
- if (null !== deletions) {
6153
- deletions.return = firstChild.return;
6154
- nextEffect = deletions;
6155
- break;
6359
+ break;
6360
+ case 19:
6361
+ recursivelyTraverseMutationEffects(root, finishedWork);
6362
+ commitReconciliationEffects(finishedWork);
6363
+ flags & 4 && attachSuspenseRetryListeners(finishedWork);
6364
+ break;
6365
+ case 21:
6366
+ break;
6367
+ default:
6368
+ recursivelyTraverseMutationEffects(root, finishedWork),
6369
+ commitReconciliationEffects(finishedWork);
6370
+ }
6371
+ }
6372
+ function commitReconciliationEffects(finishedWork) {
6373
+ var flags = finishedWork.flags;
6374
+ if (flags & 2) {
6375
+ try {
6376
+ a: {
6377
+ for (var parent = finishedWork.return; null !== parent; ) {
6378
+ if (isHostParent(parent)) {
6379
+ var JSCompiler_inline_result = parent;
6380
+ break a;
6381
+ }
6382
+ parent = parent.return;
6156
6383
  }
6157
- nextEffect = firstChild.return;
6384
+ throw Error(
6385
+ "Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue."
6386
+ );
6387
+ }
6388
+ switch (JSCompiler_inline_result.tag) {
6389
+ case 5:
6390
+ var parent$jscomp$0 = JSCompiler_inline_result.stateNode;
6391
+ JSCompiler_inline_result.flags & 32 &&
6392
+ (JSCompiler_inline_result.flags &= -33);
6393
+ var before = getHostSibling(finishedWork);
6394
+ insertOrAppendPlacementNode(finishedWork, before, parent$jscomp$0);
6395
+ break;
6396
+ case 3:
6397
+ case 4:
6398
+ var parent$79 = JSCompiler_inline_result.stateNode.containerInfo,
6399
+ before$80 = getHostSibling(finishedWork);
6400
+ insertOrAppendPlacementNodeIntoContainer(
6401
+ finishedWork,
6402
+ before$80,
6403
+ parent$79
6404
+ );
6405
+ break;
6406
+ default:
6407
+ throw Error(
6408
+ "Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue."
6409
+ );
6158
6410
  }
6411
+ } catch (error) {
6412
+ captureCommitPhaseError(finishedWork, finishedWork.return, error);
6413
+ }
6414
+ finishedWork.flags &= -3;
6159
6415
  }
6416
+ flags & 4096 && (finishedWork.flags &= -4097);
6160
6417
  }
6161
6418
  function commitLayoutEffects(finishedWork) {
6162
6419
  for (nextEffect = finishedWork; null !== nextEffect; ) {
@@ -6200,8 +6457,8 @@ function commitLayoutEffects(finishedWork) {
6200
6457
  commitUpdateQueue(firstChild, updateQueue, instance);
6201
6458
  break;
6202
6459
  case 3:
6203
- var updateQueue$78 = firstChild.updateQueue;
6204
- if (null !== updateQueue$78) {
6460
+ var updateQueue$74 = firstChild.updateQueue;
6461
+ if (null !== updateQueue$74) {
6205
6462
  current = null;
6206
6463
  if (null !== firstChild.child)
6207
6464
  switch (firstChild.child.tag) {
@@ -6211,7 +6468,7 @@ function commitLayoutEffects(finishedWork) {
6211
6468
  case 1:
6212
6469
  current = firstChild.child.stateNode;
6213
6470
  }
6214
- commitUpdateQueue(firstChild, updateQueue$78, current);
6471
+ commitUpdateQueue(firstChild, updateQueue$74, current);
6215
6472
  }
6216
6473
  break;
6217
6474
  case 5:
@@ -6229,6 +6486,7 @@ function commitLayoutEffects(finishedWork) {
6229
6486
  case 21:
6230
6487
  case 22:
6231
6488
  case 23:
6489
+ case 25:
6232
6490
  break;
6233
6491
  default:
6234
6492
  throw Error(
@@ -6289,6 +6547,7 @@ var ceil = Math.ceil,
6289
6547
  workInProgressRootRecoverableErrors = null,
6290
6548
  globalMostRecentFallbackTime = 0,
6291
6549
  workInProgressRootRenderTargetTime = Infinity,
6550
+ workInProgressTransitions = null,
6292
6551
  hasUncaughtError = !1,
6293
6552
  firstUncaughtError = null,
6294
6553
  legacyErrorBoundariesThatAlreadyFailed = null,
@@ -6313,10 +6572,7 @@ function requestUpdateLane(fiber) {
6313
6572
  if (null !== ReactCurrentBatchConfig.transition)
6314
6573
  return (
6315
6574
  0 === currentEventTransitionLane &&
6316
- ((fiber = nextTransitionLane),
6317
- (nextTransitionLane <<= 1),
6318
- 0 === (nextTransitionLane & 4194240) && (nextTransitionLane = 64),
6319
- (currentEventTransitionLane = fiber)),
6575
+ (currentEventTransitionLane = claimNextTransitionLane()),
6320
6576
  currentEventTransitionLane
6321
6577
  );
6322
6578
  fiber = currentUpdatePriority;
@@ -6359,6 +6615,13 @@ function markUpdateLaneFromFiberToRoot(sourceFiber, lane) {
6359
6615
  (sourceFiber = sourceFiber.return);
6360
6616
  return 3 === alternate.tag ? alternate.stateNode : null;
6361
6617
  }
6618
+ function isInterleavedUpdate(fiber) {
6619
+ return (
6620
+ (null !== workInProgressRoot || null !== interleavedQueues) &&
6621
+ 0 !== (fiber.mode & 1) &&
6622
+ 0 === (executionContext & 2)
6623
+ );
6624
+ }
6362
6625
  function ensureRootIsScheduled(root, currentTime) {
6363
6626
  for (
6364
6627
  var existingCallbackNode = root.callbackNode,
@@ -6454,7 +6717,8 @@ function performConcurrentWorkOnRoot(root, didTimeout) {
6454
6717
  workInProgressRoot !== root ||
6455
6718
  workInProgressRootRenderLanes !== didTimeout
6456
6719
  )
6457
- (workInProgressRootRenderTargetTime = now() + 500),
6720
+ (workInProgressTransitions = null),
6721
+ (workInProgressRootRenderTargetTime = now() + 500),
6458
6722
  prepareFreshStack(root, didTimeout);
6459
6723
  do
6460
6724
  try {
@@ -6511,7 +6775,11 @@ function performConcurrentWorkOnRoot(root, didTimeout) {
6511
6775
  case 1:
6512
6776
  throw Error("Root did not complete. This is a bug in React.");
6513
6777
  case 2:
6514
- commitRoot(root, workInProgressRootRecoverableErrors);
6778
+ commitRoot(
6779
+ root,
6780
+ workInProgressRootRecoverableErrors,
6781
+ workInProgressTransitions
6782
+ );
6515
6783
  break;
6516
6784
  case 3:
6517
6785
  markRootSuspended$1(root, lanes);
@@ -6528,12 +6796,21 @@ function performConcurrentWorkOnRoot(root, didTimeout) {
6528
6796
  break;
6529
6797
  }
6530
6798
  root.timeoutHandle = scheduleTimeout(
6531
- commitRoot.bind(null, root, workInProgressRootRecoverableErrors),
6799
+ commitRoot.bind(
6800
+ null,
6801
+ root,
6802
+ workInProgressRootRecoverableErrors,
6803
+ workInProgressTransitions
6804
+ ),
6532
6805
  didTimeout
6533
6806
  );
6534
6807
  break;
6535
6808
  }
6536
- commitRoot(root, workInProgressRootRecoverableErrors);
6809
+ commitRoot(
6810
+ root,
6811
+ workInProgressRootRecoverableErrors,
6812
+ workInProgressTransitions
6813
+ );
6537
6814
  break;
6538
6815
  case 4:
6539
6816
  markRootSuspended$1(root, lanes);
@@ -6564,15 +6841,28 @@ function performConcurrentWorkOnRoot(root, didTimeout) {
6564
6841
  : 1960 * ceil(lanes / 1960)) - lanes;
6565
6842
  if (10 < lanes) {
6566
6843
  root.timeoutHandle = scheduleTimeout(
6567
- commitRoot.bind(null, root, workInProgressRootRecoverableErrors),
6844
+ commitRoot.bind(
6845
+ null,
6846
+ root,
6847
+ workInProgressRootRecoverableErrors,
6848
+ workInProgressTransitions
6849
+ ),
6568
6850
  lanes
6569
6851
  );
6570
6852
  break;
6571
6853
  }
6572
- commitRoot(root, workInProgressRootRecoverableErrors);
6854
+ commitRoot(
6855
+ root,
6856
+ workInProgressRootRecoverableErrors,
6857
+ workInProgressTransitions
6858
+ );
6573
6859
  break;
6574
6860
  case 5:
6575
- commitRoot(root, workInProgressRootRecoverableErrors);
6861
+ commitRoot(
6862
+ root,
6863
+ workInProgressRootRecoverableErrors,
6864
+ workInProgressTransitions
6865
+ );
6576
6866
  break;
6577
6867
  default:
6578
6868
  throw Error("Unknown root exit status.");
@@ -6592,15 +6882,17 @@ function recoverFromConcurrentError(root, errorRetryLanes) {
6592
6882
  2 !== root &&
6593
6883
  ((errorRetryLanes = workInProgressRootRecoverableErrors),
6594
6884
  (workInProgressRootRecoverableErrors = errorsFromFirstAttempt),
6595
- null !== errorRetryLanes &&
6596
- (null === workInProgressRootRecoverableErrors
6597
- ? (workInProgressRootRecoverableErrors = errorRetryLanes)
6598
- : workInProgressRootRecoverableErrors.push.apply(
6599
- workInProgressRootRecoverableErrors,
6600
- errorRetryLanes
6601
- )));
6885
+ null !== errorRetryLanes && queueRecoverableErrors(errorRetryLanes));
6602
6886
  return root;
6603
6887
  }
6888
+ function queueRecoverableErrors(errors) {
6889
+ null === workInProgressRootRecoverableErrors
6890
+ ? (workInProgressRootRecoverableErrors = errors)
6891
+ : workInProgressRootRecoverableErrors.push.apply(
6892
+ workInProgressRootRecoverableErrors,
6893
+ errors
6894
+ );
6895
+ }
6604
6896
  function isRenderConsistentWithExternalStores(finishedWork) {
6605
6897
  for (var node = finishedWork; ; ) {
6606
6898
  if (node.flags & 16384) {
@@ -6670,7 +6962,11 @@ function performSyncWorkOnRoot(root) {
6670
6962
  throw Error("Root did not complete. This is a bug in React.");
6671
6963
  root.finishedWork = root.current.alternate;
6672
6964
  root.finishedLanes = lanes;
6673
- commitRoot(root, workInProgressRootRecoverableErrors);
6965
+ commitRoot(
6966
+ root,
6967
+ workInProgressRootRecoverableErrors,
6968
+ workInProgressTransitions
6969
+ );
6674
6970
  ensureRootIsScheduled(root, now());
6675
6971
  return null;
6676
6972
  }
@@ -6906,12 +7202,12 @@ function handleError(root$jscomp$0, thrownValue) {
6906
7202
  root.flags |= 65536;
6907
7203
  thrownValue &= -thrownValue;
6908
7204
  root.lanes |= thrownValue;
6909
- var update$33 = createClassErrorUpdate(
7205
+ var update$34 = createClassErrorUpdate(
6910
7206
  root,
6911
7207
  wakeable,
6912
7208
  thrownValue
6913
7209
  );
6914
- enqueueCapturedUpdate(root, update$33);
7210
+ enqueueCapturedUpdate(root, update$34);
6915
7211
  break a;
6916
7212
  }
6917
7213
  }
@@ -6950,8 +7246,8 @@ function renderRootSync(root, lanes) {
6950
7246
  var prevExecutionContext = executionContext;
6951
7247
  executionContext |= 2;
6952
7248
  var prevDispatcher = pushDispatcher();
6953
- (workInProgressRoot === root && workInProgressRootRenderLanes === lanes) ||
6954
- prepareFreshStack(root, lanes);
7249
+ if (workInProgressRoot !== root || workInProgressRootRenderLanes !== lanes)
7250
+ (workInProgressTransitions = null), prepareFreshStack(root, lanes);
6955
7251
  do
6956
7252
  try {
6957
7253
  workLoopSync();
@@ -7023,50 +7319,60 @@ function completeUnitOfWork(unitOfWork) {
7023
7319
  } while (null !== completedWork);
7024
7320
  0 === workInProgressRootExitStatus && (workInProgressRootExitStatus = 5);
7025
7321
  }
7026
- function commitRoot(root, recoverableErrors) {
7322
+ function commitRoot(root, recoverableErrors, transitions) {
7027
7323
  var previousUpdateLanePriority = currentUpdatePriority,
7028
7324
  prevTransition = ReactCurrentBatchConfig$2.transition;
7029
7325
  try {
7030
7326
  (ReactCurrentBatchConfig$2.transition = null),
7031
7327
  (currentUpdatePriority = 1),
7032
- commitRootImpl(root, recoverableErrors, previousUpdateLanePriority);
7328
+ commitRootImpl(
7329
+ root,
7330
+ recoverableErrors,
7331
+ transitions,
7332
+ previousUpdateLanePriority
7333
+ );
7033
7334
  } finally {
7034
7335
  (ReactCurrentBatchConfig$2.transition = prevTransition),
7035
7336
  (currentUpdatePriority = previousUpdateLanePriority);
7036
7337
  }
7037
7338
  return null;
7038
7339
  }
7039
- function commitRootImpl(root, recoverableErrors, renderPriorityLevel) {
7340
+ function commitRootImpl(
7341
+ root,
7342
+ recoverableErrors,
7343
+ transitions,
7344
+ renderPriorityLevel
7345
+ ) {
7040
7346
  do flushPassiveEffects();
7041
7347
  while (null !== rootWithPendingPassiveEffects);
7042
7348
  if (0 !== (executionContext & 6))
7043
7349
  throw Error("Should not already be working.");
7044
- var finishedWork = root.finishedWork,
7045
- lanes = root.finishedLanes;
7046
- if (null === finishedWork) return null;
7350
+ transitions = root.finishedWork;
7351
+ var lanes = root.finishedLanes;
7352
+ if (null === transitions) return null;
7047
7353
  root.finishedWork = null;
7048
7354
  root.finishedLanes = 0;
7049
- if (finishedWork === root.current)
7355
+ if (transitions === root.current)
7050
7356
  throw Error(
7051
7357
  "Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue."
7052
7358
  );
7053
7359
  root.callbackNode = null;
7054
7360
  root.callbackPriority = 0;
7055
- var remainingLanes = finishedWork.lanes | finishedWork.childLanes;
7361
+ var remainingLanes = transitions.lanes | transitions.childLanes;
7056
7362
  markRootFinished(root, remainingLanes);
7057
7363
  root === workInProgressRoot &&
7058
7364
  ((workInProgress = workInProgressRoot = null),
7059
7365
  (workInProgressRootRenderLanes = 0));
7060
- (0 === (finishedWork.subtreeFlags & 2064) &&
7061
- 0 === (finishedWork.flags & 2064)) ||
7366
+ (0 === (transitions.subtreeFlags & 2064) &&
7367
+ 0 === (transitions.flags & 2064)) ||
7062
7368
  rootDoesHavePassiveEffects ||
7063
7369
  ((rootDoesHavePassiveEffects = !0),
7064
7370
  scheduleCallback$1(NormalPriority, function() {
7065
7371
  flushPassiveEffects();
7066
7372
  return null;
7067
7373
  }));
7068
- remainingLanes = 0 !== (finishedWork.flags & 15990);
7069
- if (0 !== (finishedWork.subtreeFlags & 15990) || remainingLanes) {
7374
+ remainingLanes = 0 !== (transitions.flags & 15990);
7375
+ if (0 !== (transitions.subtreeFlags & 15990) || remainingLanes) {
7070
7376
  remainingLanes = ReactCurrentBatchConfig$2.transition;
7071
7377
  ReactCurrentBatchConfig$2.transition = null;
7072
7378
  var previousPriority = currentUpdatePriority;
@@ -7074,30 +7380,30 @@ function commitRootImpl(root, recoverableErrors, renderPriorityLevel) {
7074
7380
  var prevExecutionContext = executionContext;
7075
7381
  executionContext |= 4;
7076
7382
  ReactCurrentOwner$2.current = null;
7077
- commitBeforeMutationEffects(root, finishedWork);
7078
- commitMutationEffects(root, finishedWork, lanes);
7079
- root.current = finishedWork;
7080
- commitLayoutEffects(finishedWork, root, lanes);
7383
+ commitBeforeMutationEffects(root, transitions);
7384
+ commitMutationEffectsOnFiber(transitions, root);
7385
+ root.current = transitions;
7386
+ commitLayoutEffects(transitions, root, lanes);
7081
7387
  requestPaint();
7082
7388
  executionContext = prevExecutionContext;
7083
7389
  currentUpdatePriority = previousPriority;
7084
7390
  ReactCurrentBatchConfig$2.transition = remainingLanes;
7085
- } else root.current = finishedWork;
7391
+ } else root.current = transitions;
7086
7392
  rootDoesHavePassiveEffects &&
7087
7393
  ((rootDoesHavePassiveEffects = !1),
7088
7394
  (rootWithPendingPassiveEffects = root),
7089
7395
  (pendingPassiveEffectsLanes = lanes));
7090
7396
  remainingLanes = root.pendingLanes;
7091
7397
  0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null);
7092
- onCommitRoot(finishedWork.stateNode, renderPriorityLevel);
7398
+ onCommitRoot(transitions.stateNode, renderPriorityLevel);
7093
7399
  ensureRootIsScheduled(root, now());
7094
7400
  if (null !== recoverableErrors)
7095
7401
  for (
7096
- renderPriorityLevel = root.onRecoverableError, finishedWork = 0;
7097
- finishedWork < recoverableErrors.length;
7098
- finishedWork++
7402
+ renderPriorityLevel = root.onRecoverableError, transitions = 0;
7403
+ transitions < recoverableErrors.length;
7404
+ transitions++
7099
7405
  )
7100
- renderPriorityLevel(recoverableErrors[finishedWork]);
7406
+ renderPriorityLevel(recoverableErrors[transitions]);
7101
7407
  if (hasUncaughtError)
7102
7408
  throw ((hasUncaughtError = !1),
7103
7409
  (root = firstUncaughtError),
@@ -7332,21 +7638,43 @@ function pingSuspendedRoot(root, wakeable, pingedLanes) {
7332
7638
  : (workInProgressRootPingedLanes |= pingedLanes));
7333
7639
  ensureRootIsScheduled(root, wakeable);
7334
7640
  }
7335
- function resolveRetryWakeable(boundaryFiber, wakeable) {
7336
- var retryCache = boundaryFiber.stateNode;
7337
- null !== retryCache && retryCache.delete(wakeable);
7338
- wakeable = 0;
7339
- 0 === wakeable &&
7641
+ function retryTimedOutBoundary(boundaryFiber, retryLane) {
7642
+ 0 === retryLane &&
7340
7643
  (0 === (boundaryFiber.mode & 1)
7341
- ? (wakeable = 1)
7342
- : ((wakeable = nextRetryLane),
7644
+ ? (retryLane = 1)
7645
+ : ((retryLane = nextRetryLane),
7343
7646
  (nextRetryLane <<= 1),
7344
7647
  0 === (nextRetryLane & 130023424) && (nextRetryLane = 4194304)));
7345
- retryCache = requestEventTime();
7346
- boundaryFiber = markUpdateLaneFromFiberToRoot(boundaryFiber, wakeable);
7648
+ var eventTime = requestEventTime();
7649
+ boundaryFiber = markUpdateLaneFromFiberToRoot(boundaryFiber, retryLane);
7347
7650
  null !== boundaryFiber &&
7348
- (markRootUpdated(boundaryFiber, wakeable, retryCache),
7349
- ensureRootIsScheduled(boundaryFiber, retryCache));
7651
+ (markRootUpdated(boundaryFiber, retryLane, eventTime),
7652
+ ensureRootIsScheduled(boundaryFiber, eventTime));
7653
+ }
7654
+ function retryDehydratedSuspenseBoundary(boundaryFiber) {
7655
+ var suspenseState = boundaryFiber.memoizedState,
7656
+ retryLane = 0;
7657
+ null !== suspenseState && (retryLane = suspenseState.retryLane);
7658
+ retryTimedOutBoundary(boundaryFiber, retryLane);
7659
+ }
7660
+ function resolveRetryWakeable(boundaryFiber, wakeable) {
7661
+ var retryLane = 0;
7662
+ switch (boundaryFiber.tag) {
7663
+ case 13:
7664
+ var retryCache = boundaryFiber.stateNode;
7665
+ var suspenseState = boundaryFiber.memoizedState;
7666
+ null !== suspenseState && (retryLane = suspenseState.retryLane);
7667
+ break;
7668
+ case 19:
7669
+ retryCache = boundaryFiber.stateNode;
7670
+ break;
7671
+ default:
7672
+ throw Error(
7673
+ "Pinged unknown suspense boundary type. This is probably a bug in React."
7674
+ );
7675
+ }
7676
+ null !== retryCache && retryCache.delete(wakeable);
7677
+ retryTimedOutBoundary(boundaryFiber, retryLane);
7350
7678
  }
7351
7679
  var beginWork$1;
7352
7680
  beginWork$1 = function(current, workInProgress, renderLanes) {
@@ -7376,10 +7704,7 @@ beginWork$1 = function(current, workInProgress, renderLanes) {
7376
7704
  switch (workInProgress.tag) {
7377
7705
  case 2:
7378
7706
  var Component = workInProgress.type;
7379
- null !== current &&
7380
- ((current.alternate = null),
7381
- (workInProgress.alternate = null),
7382
- (workInProgress.flags |= 2));
7707
+ resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress);
7383
7708
  current = workInProgress.pendingProps;
7384
7709
  var context = getMaskedContext(
7385
7710
  workInProgress,
@@ -7433,10 +7758,7 @@ beginWork$1 = function(current, workInProgress, renderLanes) {
7433
7758
  case 16:
7434
7759
  Component = workInProgress.elementType;
7435
7760
  a: {
7436
- null !== current &&
7437
- ((current.alternate = null),
7438
- (workInProgress.alternate = null),
7439
- (workInProgress.flags |= 2));
7761
+ resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress);
7440
7762
  current = workInProgress.pendingProps;
7441
7763
  context = Component._init;
7442
7764
  Component = context(Component._payload);
@@ -7542,7 +7864,7 @@ beginWork$1 = function(current, workInProgress, renderLanes) {
7542
7864
  return (
7543
7865
  pushHostContext(workInProgress),
7544
7866
  (Component = workInProgress.pendingProps.children),
7545
- markRef$1(current, workInProgress),
7867
+ markRef(current, workInProgress),
7546
7868
  reconcileChildren(current, workInProgress, Component, renderLanes),
7547
7869
  workInProgress.child
7548
7870
  );
@@ -7636,24 +7958,24 @@ beginWork$1 = function(current, workInProgress, renderLanes) {
7636
7958
  }
7637
7959
  } else
7638
7960
  for (
7639
- newValue = workInProgress.child,
7640
- null !== newValue && (newValue.return = workInProgress);
7641
- null !== newValue;
7961
+ hasContext = workInProgress.child,
7962
+ null !== hasContext && (hasContext.return = workInProgress);
7963
+ null !== hasContext;
7642
7964
 
7643
7965
  ) {
7644
- var list = newValue.dependencies;
7966
+ var list = hasContext.dependencies;
7645
7967
  if (null !== list) {
7646
- hasContext = newValue.child;
7968
+ newValue = hasContext.child;
7647
7969
  for (
7648
7970
  var dependency = list.firstContext;
7649
7971
  null !== dependency;
7650
7972
 
7651
7973
  ) {
7652
7974
  if (dependency.context === Component) {
7653
- if (1 === newValue.tag) {
7975
+ if (1 === hasContext.tag) {
7654
7976
  dependency = createUpdate(-1, renderLanes & -renderLanes);
7655
7977
  dependency.tag = 2;
7656
- var updateQueue = newValue.updateQueue;
7978
+ var updateQueue = hasContext.updateQueue;
7657
7979
  if (null !== updateQueue) {
7658
7980
  updateQueue = updateQueue.shared;
7659
7981
  var pending = updateQueue.pending;
@@ -7664,11 +7986,11 @@ beginWork$1 = function(current, workInProgress, renderLanes) {
7664
7986
  updateQueue.pending = dependency;
7665
7987
  }
7666
7988
  }
7667
- newValue.lanes |= renderLanes;
7668
- dependency = newValue.alternate;
7989
+ hasContext.lanes |= renderLanes;
7990
+ dependency = hasContext.alternate;
7669
7991
  null !== dependency && (dependency.lanes |= renderLanes);
7670
7992
  scheduleContextWorkOnParentPath(
7671
- newValue.return,
7993
+ hasContext.return,
7672
7994
  renderLanes,
7673
7995
  workInProgress
7674
7996
  );
@@ -7677,29 +7999,43 @@ beginWork$1 = function(current, workInProgress, renderLanes) {
7677
7999
  }
7678
8000
  dependency = dependency.next;
7679
8001
  }
7680
- } else
7681
- hasContext =
7682
- 10 === newValue.tag
7683
- ? newValue.type === workInProgress.type
7684
- ? null
7685
- : newValue.child
7686
- : newValue.child;
7687
- if (null !== hasContext) hasContext.return = newValue;
8002
+ } else if (10 === hasContext.tag)
8003
+ newValue =
8004
+ hasContext.type === workInProgress.type
8005
+ ? null
8006
+ : hasContext.child;
8007
+ else if (18 === hasContext.tag) {
8008
+ newValue = hasContext.return;
8009
+ if (null === newValue)
8010
+ throw Error(
8011
+ "We just came from a parent so we must have had a parent. This is a bug in React."
8012
+ );
8013
+ newValue.lanes |= renderLanes;
8014
+ list = newValue.alternate;
8015
+ null !== list && (list.lanes |= renderLanes);
8016
+ scheduleContextWorkOnParentPath(
8017
+ newValue,
8018
+ renderLanes,
8019
+ workInProgress
8020
+ );
8021
+ newValue = hasContext.sibling;
8022
+ } else newValue = hasContext.child;
8023
+ if (null !== newValue) newValue.return = hasContext;
7688
8024
  else
7689
- for (hasContext = newValue; null !== hasContext; ) {
7690
- if (hasContext === workInProgress) {
7691
- hasContext = null;
8025
+ for (newValue = hasContext; null !== newValue; ) {
8026
+ if (newValue === workInProgress) {
8027
+ newValue = null;
7692
8028
  break;
7693
8029
  }
7694
- newValue = hasContext.sibling;
7695
- if (null !== newValue) {
7696
- newValue.return = hasContext.return;
7697
- hasContext = newValue;
8030
+ hasContext = newValue.sibling;
8031
+ if (null !== hasContext) {
8032
+ hasContext.return = newValue.return;
8033
+ newValue = hasContext;
7698
8034
  break;
7699
8035
  }
7700
- hasContext = hasContext.return;
8036
+ newValue = newValue.return;
7701
8037
  }
7702
- newValue = hasContext;
8038
+ hasContext = newValue;
7703
8039
  }
7704
8040
  reconcileChildren(
7705
8041
  current,
@@ -7750,10 +8086,7 @@ beginWork$1 = function(current, workInProgress, renderLanes) {
7750
8086
  workInProgress.elementType === Component
7751
8087
  ? context
7752
8088
  : resolveDefaultProps(Component, context)),
7753
- null !== current &&
7754
- ((current.alternate = null),
7755
- (workInProgress.alternate = null),
7756
- (workInProgress.flags |= 2)),
8089
+ resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress),
7757
8090
  (workInProgress.tag = 1),
7758
8091
  isContextProvider(Component)
7759
8092
  ? ((current = !0), pushContextProvider(workInProgress))
@@ -8100,10 +8433,10 @@ batchedUpdatesImpl = function(fn, a) {
8100
8433
  }
8101
8434
  };
8102
8435
  var roots = new Map(),
8103
- devToolsConfig$jscomp$inline_963 = {
8436
+ devToolsConfig$jscomp$inline_967 = {
8104
8437
  findFiberByHostInstance: getInstanceFromTag,
8105
8438
  bundleType: 0,
8106
- version: "18.0.0-experimental-34aa5cfe0-20220329",
8439
+ version: "18.2.0-next-d300cebde-20220601",
8107
8440
  rendererPackageName: "react-native-renderer",
8108
8441
  rendererConfig: {
8109
8442
  getInspectorDataForViewTag: function() {
@@ -8118,11 +8451,11 @@ var roots = new Map(),
8118
8451
  }.bind(null, findNodeHandle)
8119
8452
  }
8120
8453
  };
8121
- var internals$jscomp$inline_1217 = {
8122
- bundleType: devToolsConfig$jscomp$inline_963.bundleType,
8123
- version: devToolsConfig$jscomp$inline_963.version,
8124
- rendererPackageName: devToolsConfig$jscomp$inline_963.rendererPackageName,
8125
- rendererConfig: devToolsConfig$jscomp$inline_963.rendererConfig,
8454
+ var internals$jscomp$inline_1239 = {
8455
+ bundleType: devToolsConfig$jscomp$inline_967.bundleType,
8456
+ version: devToolsConfig$jscomp$inline_967.version,
8457
+ rendererPackageName: devToolsConfig$jscomp$inline_967.rendererPackageName,
8458
+ rendererConfig: devToolsConfig$jscomp$inline_967.rendererConfig,
8126
8459
  overrideHookState: null,
8127
8460
  overrideHookStateDeletePath: null,
8128
8461
  overrideHookStateRenamePath: null,
@@ -8138,26 +8471,26 @@ var internals$jscomp$inline_1217 = {
8138
8471
  return null === fiber ? null : fiber.stateNode;
8139
8472
  },
8140
8473
  findFiberByHostInstance:
8141
- devToolsConfig$jscomp$inline_963.findFiberByHostInstance ||
8474
+ devToolsConfig$jscomp$inline_967.findFiberByHostInstance ||
8142
8475
  emptyFindFiberByHostInstance,
8143
8476
  findHostInstancesForRefresh: null,
8144
8477
  scheduleRefresh: null,
8145
8478
  scheduleRoot: null,
8146
8479
  setRefreshHandler: null,
8147
8480
  getCurrentFiber: null,
8148
- reconcilerVersion: "18.0.0-experimental-34aa5cfe0-20220329"
8481
+ reconcilerVersion: "18.2.0-next-d300cebde-20220601"
8149
8482
  };
8150
8483
  if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
8151
- var hook$jscomp$inline_1218 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
8484
+ var hook$jscomp$inline_1240 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
8152
8485
  if (
8153
- !hook$jscomp$inline_1218.isDisabled &&
8154
- hook$jscomp$inline_1218.supportsFiber
8486
+ !hook$jscomp$inline_1240.isDisabled &&
8487
+ hook$jscomp$inline_1240.supportsFiber
8155
8488
  )
8156
8489
  try {
8157
- (rendererID = hook$jscomp$inline_1218.inject(
8158
- internals$jscomp$inline_1217
8490
+ (rendererID = hook$jscomp$inline_1240.inject(
8491
+ internals$jscomp$inline_1239
8159
8492
  )),
8160
- (injectedHook = hook$jscomp$inline_1218);
8493
+ (injectedHook = hook$jscomp$inline_1240);
8161
8494
  } catch (err) {}
8162
8495
  }
8163
8496
  exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = {
@@ -8212,7 +8545,8 @@ exports.render = function(element, containerTag, callback) {
8212
8545
  element: null,
8213
8546
  isDehydrated: !1,
8214
8547
  cache: null,
8215
- transitions: null
8548
+ transitions: null,
8549
+ pendingSuspenseBoundaries: null
8216
8550
  };
8217
8551
  initializeUpdateQueue(JSCompiler_inline_result);
8218
8552
  roots.set(containerTag, root);