react 19.1.0 → 19.2.0-canary-e5dd82a7-20250401

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.
@@ -498,6 +498,9 @@
498
498
  );
499
499
  return dispatcher;
500
500
  }
501
+ function releaseAsyncTransition() {
502
+ ReactSharedInternals.asyncTransitions--;
503
+ }
501
504
  function noop() {}
502
505
  function enqueueTask(task) {
503
506
  if (null === enqueueTaskImpl)
@@ -660,8 +663,8 @@
660
663
  A: null,
661
664
  T: null,
662
665
  S: null,
663
- V: null,
664
666
  actQueue: null,
667
+ asyncTransitions: 0,
665
668
  isBatchingLegacy: !1,
666
669
  didScheduleLegacyUpdate: !1,
667
670
  didUsePromise: !1,
@@ -1118,8 +1121,8 @@
1118
1121
  exports.startTransition = function (scope) {
1119
1122
  var prevTransition = ReactSharedInternals.T,
1120
1123
  currentTransition = {};
1121
- ReactSharedInternals.T = currentTransition;
1122
1124
  currentTransition._updatedFibers = new Set();
1125
+ ReactSharedInternals.T = currentTransition;
1123
1126
  try {
1124
1127
  var returnValue = scope(),
1125
1128
  onStartTransitionFinish = ReactSharedInternals.S;
@@ -1128,7 +1131,9 @@
1128
1131
  "object" === typeof returnValue &&
1129
1132
  null !== returnValue &&
1130
1133
  "function" === typeof returnValue.then &&
1131
- returnValue.then(noop, reportGlobalError);
1134
+ (ReactSharedInternals.asyncTransitions++,
1135
+ returnValue.then(releaseAsyncTransition, releaseAsyncTransition),
1136
+ returnValue.then(noop, reportGlobalError));
1132
1137
  } catch (error) {
1133
1138
  reportGlobalError(error);
1134
1139
  } finally {
@@ -1140,6 +1145,14 @@
1140
1145
  console.warn(
1141
1146
  "Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."
1142
1147
  )),
1148
+ null !== prevTransition &&
1149
+ null !== currentTransition.types &&
1150
+ (null !== prevTransition.types &&
1151
+ prevTransition.types !== currentTransition.types &&
1152
+ console.error(
1153
+ "We expected inner Transitions to have transferred the outer types set and that you cannot add to the outer Transition while inside the inner.This is a bug in React."
1154
+ ),
1155
+ (prevTransition.types = currentTransition.types)),
1143
1156
  (ReactSharedInternals.T = prevTransition);
1144
1157
  }
1145
1158
  };
@@ -1173,17 +1186,12 @@
1173
1186
  exports.useDeferredValue = function (value, initialValue) {
1174
1187
  return resolveDispatcher().useDeferredValue(value, initialValue);
1175
1188
  };
1176
- exports.useEffect = function (create, createDeps, update) {
1189
+ exports.useEffect = function (create, deps) {
1177
1190
  null == create &&
1178
1191
  console.warn(
1179
1192
  "React Hook useEffect requires an effect callback. Did you forget to pass a callback to the hook?"
1180
1193
  );
1181
- var dispatcher = resolveDispatcher();
1182
- if ("function" === typeof update)
1183
- throw Error(
1184
- "useEffect CRUD overload is not enabled in this build of React."
1185
- );
1186
- return dispatcher.useEffect(create, createDeps);
1194
+ return resolveDispatcher().useEffect(create, deps);
1187
1195
  };
1188
1196
  exports.useId = function () {
1189
1197
  return resolveDispatcher().useId();
@@ -1234,7 +1242,7 @@
1234
1242
  exports.useTransition = function () {
1235
1243
  return resolveDispatcher().useTransition();
1236
1244
  };
1237
- exports.version = "19.1.0";
1245
+ exports.version = "19.2.0-canary-e5dd82a7-20250401";
1238
1246
  "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
1239
1247
  "function" ===
1240
1248
  typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
@@ -72,7 +72,7 @@ pureComponentPrototype.constructor = PureComponent;
72
72
  assign(pureComponentPrototype, Component.prototype);
73
73
  pureComponentPrototype.isPureReactComponent = !0;
74
74
  var isArrayImpl = Array.isArray,
75
- ReactSharedInternals = { H: null, A: null, T: null, S: null, V: null },
75
+ ReactSharedInternals = { H: null, A: null, T: null, S: null },
76
76
  hasOwnProperty = Object.prototype.hasOwnProperty;
77
77
  function ReactElement(type, key, self, source, owner, props) {
78
78
  self = props.ref;
@@ -472,7 +472,10 @@ exports.startTransition = function (scope) {
472
472
  } catch (error) {
473
473
  reportGlobalError(error);
474
474
  } finally {
475
- ReactSharedInternals.T = prevTransition;
475
+ null !== prevTransition &&
476
+ null !== currentTransition.types &&
477
+ (prevTransition.types = currentTransition.types),
478
+ (ReactSharedInternals.T = prevTransition);
476
479
  }
477
480
  };
478
481
  exports.unstable_useCacheRefresh = function () {
@@ -494,13 +497,8 @@ exports.useDebugValue = function () {};
494
497
  exports.useDeferredValue = function (value, initialValue) {
495
498
  return ReactSharedInternals.H.useDeferredValue(value, initialValue);
496
499
  };
497
- exports.useEffect = function (create, createDeps, update) {
498
- var dispatcher = ReactSharedInternals.H;
499
- if ("function" === typeof update)
500
- throw Error(
501
- "useEffect CRUD overload is not enabled in this build of React."
502
- );
503
- return dispatcher.useEffect(create, createDeps);
500
+ exports.useEffect = function (create, deps) {
501
+ return ReactSharedInternals.H.useEffect(create, deps);
504
502
  };
505
503
  exports.useId = function () {
506
504
  return ReactSharedInternals.H.useId();
@@ -543,4 +541,4 @@ exports.useSyncExternalStore = function (
543
541
  exports.useTransition = function () {
544
542
  return ReactSharedInternals.H.useTransition();
545
543
  };
546
- exports.version = "19.1.0";
544
+ exports.version = "19.2.0-canary-e5dd82a7-20250401";
@@ -811,5 +811,5 @@
811
811
  exports.useMemo = function (create, deps) {
812
812
  return resolveDispatcher().useMemo(create, deps);
813
813
  };
814
- exports.version = "19.1.0";
814
+ exports.version = "19.2.0-canary-e5dd82a7-20250401";
815
815
  })();
@@ -426,4 +426,4 @@ exports.useId = function () {
426
426
  exports.useMemo = function (create, deps) {
427
427
  return ReactSharedInternals.H.useMemo(create, deps);
428
428
  };
429
- exports.version = "19.1.0";
429
+ exports.version = "19.2.0-canary-e5dd82a7-20250401";
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "keywords": [
5
5
  "react"
6
6
  ],
7
- "version": "19.1.0",
7
+ "version": "19.2.0-canary-e5dd82a7-20250401",
8
8
  "homepage": "https://react.dev/",
9
9
  "bugs": "https://github.com/facebook/react/issues",
10
10
  "license": "MIT",