useActionState: On error, cancel remaining actions (#29695)

Based on

- #29694

---

If an action in the useActionState queue errors, we shouldn't run any
subsequent actions. The contract of useActionState is that the actions
run in sequence, and that one action can assume that all previous
actions have completed successfully.

For example, in a shopping cart UI, you might dispatch an "Add to cart"
action followed by a "Checkout" action. If the "Add to cart" action
errors, the "Checkout" action should not run.

An implication of this change is that once useActionState falls into an
error state, the only way to recover is to reset the component tree,
i.e. by unmounting and remounting. The way to customize the error
handling behavior is to wrap the action body in a try/catch.

DiffTrain build for [9598c41a20](https://github.com/facebook/react/commit/9598c41a20162c8a9d57ccf6a356aa183b00b61a)
This commit is contained in:
acdlite
2024-06-03 15:33:06 +00:00
parent a56f5cf224
commit 27402d4be2
34 changed files with 630 additions and 570 deletions
+1 -1
View File
@@ -1 +1 @@
67b05be0d216c4efebc4bb5acb12c861a18bd87c
9598c41a20162c8a9d57ccf6a356aa183b00b61a
+1 -1
View File
@@ -1 +1 @@
67b05be0d216c4efebc4bb5acb12c861a18bd87c
9598c41a20162c8a9d57ccf6a356aa183b00b61a
+1 -1
View File
@@ -22,7 +22,7 @@ if (
) {
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
}
var ReactVersion = '19.0.0-www-classic-67b05be0d2-20240603';
var ReactVersion = '19.0.0-www-classic-9598c41a20-20240603';
// Re-export dynamic flags from the www version.
var dynamicFeatureFlags = require('ReactFeatureFlags');
+1 -1
View File
@@ -22,7 +22,7 @@ if (
) {
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
}
var ReactVersion = '19.0.0-www-modern-67b05be0d2-20240603';
var ReactVersion = '19.0.0-www-modern-9598c41a20-20240603';
// Re-export dynamic flags from the www version.
var dynamicFeatureFlags = require('ReactFeatureFlags');
+1 -1
View File
@@ -684,4 +684,4 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
};
exports.version = "19.0.0-www-classic-67b05be0d2-20240603";
exports.version = "19.0.0-www-classic-9598c41a20-20240603";
+1 -1
View File
@@ -684,4 +684,4 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
};
exports.version = "19.0.0-www-modern-67b05be0d2-20240603";
exports.version = "19.0.0-www-modern-9598c41a20-20240603";
@@ -688,7 +688,7 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
};
exports.version = "19.0.0-www-classic-67b05be0d2-20240603";
exports.version = "19.0.0-www-classic-9598c41a20-20240603";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
@@ -688,7 +688,7 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
};
exports.version = "19.0.0-www-modern-67b05be0d2-20240603";
exports.version = "19.0.0-www-modern-9598c41a20-20240603";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
+20 -18
View File
@@ -60,7 +60,7 @@ function _assertThisInitialized(self) {
return self;
}
var ReactVersion = '19.0.0-www-classic-67b05be0d2-20240603';
var ReactVersion = '19.0.0-www-classic-9598c41a20-20240603';
var LegacyRoot = 0;
var ConcurrentRoot = 1;
@@ -9272,9 +9272,16 @@ function dispatchActionState(fiber, actionQueue, setPendingState, setState, payl
throw new Error('Cannot update form state while rendering.');
}
var currentAction = actionQueue.action;
if (currentAction === null) {
// An earlier action errored. Subsequent actions should not run.
return;
}
var actionNode = {
payload: payload,
action: actionQueue.action,
action: currentAction,
next: null,
// circular
isTransition: true,
@@ -9433,28 +9440,23 @@ function onActionSuccess(actionQueue, actionNode, nextState) {
}
function onActionError(actionQueue, actionNode, error) {
actionNode.status = 'rejected';
actionNode.reason = error;
notifyActionListeners(actionNode); // Pop the action from the queue and run the next pending action, if there
// are any.
// TODO: We should instead abort all the remaining actions in the queue.
// Mark all the following actions as rejected.
var last = actionQueue.pending;
actionQueue.pending = null;
if (last !== null) {
var first = last.next;
if (first === last) {
// This was the last action in the queue.
actionQueue.pending = null;
} else {
// Remove the first node from the circular queue.
var next = first.next;
last.next = next; // Run the next action.
do {
actionNode.status = 'rejected';
actionNode.reason = error;
notifyActionListeners(actionNode);
actionNode = actionNode.next;
} while (actionNode !== first);
} // Prevent subsequent actions from being dispatched.
runActionStateAction(actionQueue, next);
}
}
actionQueue.action = null;
}
function notifyActionListeners(actionNode) {
+20 -18
View File
@@ -60,7 +60,7 @@ function _assertThisInitialized(self) {
return self;
}
var ReactVersion = '19.0.0-www-modern-67b05be0d2-20240603';
var ReactVersion = '19.0.0-www-modern-9598c41a20-20240603';
var LegacyRoot = 0;
var ConcurrentRoot = 1;
@@ -9061,9 +9061,16 @@ function dispatchActionState(fiber, actionQueue, setPendingState, setState, payl
throw new Error('Cannot update form state while rendering.');
}
var currentAction = actionQueue.action;
if (currentAction === null) {
// An earlier action errored. Subsequent actions should not run.
return;
}
var actionNode = {
payload: payload,
action: actionQueue.action,
action: currentAction,
next: null,
// circular
isTransition: true,
@@ -9222,28 +9229,23 @@ function onActionSuccess(actionQueue, actionNode, nextState) {
}
function onActionError(actionQueue, actionNode, error) {
actionNode.status = 'rejected';
actionNode.reason = error;
notifyActionListeners(actionNode); // Pop the action from the queue and run the next pending action, if there
// are any.
// TODO: We should instead abort all the remaining actions in the queue.
// Mark all the following actions as rejected.
var last = actionQueue.pending;
actionQueue.pending = null;
if (last !== null) {
var first = last.next;
if (first === last) {
// This was the last action in the queue.
actionQueue.pending = null;
} else {
// Remove the first node from the circular queue.
var next = first.next;
last.next = next; // Run the next action.
do {
actionNode.status = 'rejected';
actionNode.reason = error;
notifyActionListeners(actionNode);
actionNode = actionNode.next;
} while (actionNode !== first);
} // Prevent subsequent actions from being dispatched.
runActionStateAction(actionQueue, next);
}
}
actionQueue.action = null;
}
function notifyActionListeners(actionNode) {
+40 -36
View File
@@ -3018,29 +3018,32 @@ function dispatchActionState(
payload
) {
if (isRenderPhaseUpdate(fiber)) throw Error(formatProdErrorMessage(485));
var actionNode = {
payload: payload,
action: actionQueue.action,
next: null,
isTransition: !0,
status: "pending",
value: null,
reason: null,
listeners: [],
then: function (listener) {
actionNode.listeners.push(listener);
}
};
null !== ReactSharedInternals.T
? setPendingState(!0)
: (actionNode.isTransition = !1);
setState(actionNode);
fiber = actionQueue.pending;
null === fiber
? ((actionNode.next = actionQueue.pending = actionNode),
runActionStateAction(actionQueue, actionNode))
: ((actionNode.next = fiber.next),
(actionQueue.pending = fiber.next = actionNode));
fiber = actionQueue.action;
if (null !== fiber) {
var actionNode = {
payload: payload,
action: fiber,
next: null,
isTransition: !0,
status: "pending",
value: null,
reason: null,
listeners: [],
then: function (listener) {
actionNode.listeners.push(listener);
}
};
null !== ReactSharedInternals.T
? setPendingState(!0)
: (actionNode.isTransition = !1);
setState(actionNode);
setPendingState = actionQueue.pending;
null === setPendingState
? ((actionNode.next = actionQueue.pending = actionNode),
runActionStateAction(actionQueue, actionNode))
: ((actionNode.next = setPendingState.next),
(actionQueue.pending = setPendingState.next = actionNode));
}
}
function runActionStateAction(actionQueue, node) {
var action = node.action,
@@ -3098,17 +3101,18 @@ function onActionSuccess(actionQueue, actionNode, nextState) {
runActionStateAction(actionQueue, nextState)));
}
function onActionError(actionQueue, actionNode, error) {
actionNode.status = "rejected";
actionNode.reason = error;
notifyActionListeners(actionNode);
actionNode = actionQueue.pending;
null !== actionNode &&
((error = actionNode.next),
error === actionNode
? (actionQueue.pending = null)
: ((error = error.next),
(actionNode.next = error),
runActionStateAction(actionQueue, error)));
var last = actionQueue.pending;
actionQueue.pending = null;
if (null !== last) {
last = last.next;
do
(actionNode.status = "rejected"),
(actionNode.reason = error),
notifyActionListeners(actionNode),
(actionNode = actionNode.next);
while (actionNode !== last);
}
actionQueue.action = null;
}
function notifyActionListeners(actionNode) {
actionNode = actionNode.listeners;
@@ -10674,7 +10678,7 @@ var slice = Array.prototype.slice,
return null;
},
bundleType: 0,
version: "19.0.0-www-classic-67b05be0d2-20240603",
version: "19.0.0-www-classic-9598c41a20-20240603",
rendererPackageName: "react-art"
};
var internals$jscomp$inline_1371 = {
@@ -10705,7 +10709,7 @@ var internals$jscomp$inline_1371 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "19.0.0-www-classic-67b05be0d2-20240603"
reconcilerVersion: "19.0.0-www-classic-9598c41a20-20240603"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1372 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
+40 -36
View File
@@ -2816,29 +2816,32 @@ function dispatchActionState(
payload
) {
if (isRenderPhaseUpdate(fiber)) throw Error(formatProdErrorMessage(485));
var actionNode = {
payload: payload,
action: actionQueue.action,
next: null,
isTransition: !0,
status: "pending",
value: null,
reason: null,
listeners: [],
then: function (listener) {
actionNode.listeners.push(listener);
}
};
null !== ReactSharedInternals.T
? setPendingState(!0)
: (actionNode.isTransition = !1);
setState(actionNode);
fiber = actionQueue.pending;
null === fiber
? ((actionNode.next = actionQueue.pending = actionNode),
runActionStateAction(actionQueue, actionNode))
: ((actionNode.next = fiber.next),
(actionQueue.pending = fiber.next = actionNode));
fiber = actionQueue.action;
if (null !== fiber) {
var actionNode = {
payload: payload,
action: fiber,
next: null,
isTransition: !0,
status: "pending",
value: null,
reason: null,
listeners: [],
then: function (listener) {
actionNode.listeners.push(listener);
}
};
null !== ReactSharedInternals.T
? setPendingState(!0)
: (actionNode.isTransition = !1);
setState(actionNode);
setPendingState = actionQueue.pending;
null === setPendingState
? ((actionNode.next = actionQueue.pending = actionNode),
runActionStateAction(actionQueue, actionNode))
: ((actionNode.next = setPendingState.next),
(actionQueue.pending = setPendingState.next = actionNode));
}
}
function runActionStateAction(actionQueue, node) {
var action = node.action,
@@ -2896,17 +2899,18 @@ function onActionSuccess(actionQueue, actionNode, nextState) {
runActionStateAction(actionQueue, nextState)));
}
function onActionError(actionQueue, actionNode, error) {
actionNode.status = "rejected";
actionNode.reason = error;
notifyActionListeners(actionNode);
actionNode = actionQueue.pending;
null !== actionNode &&
((error = actionNode.next),
error === actionNode
? (actionQueue.pending = null)
: ((error = error.next),
(actionNode.next = error),
runActionStateAction(actionQueue, error)));
var last = actionQueue.pending;
actionQueue.pending = null;
if (null !== last) {
last = last.next;
do
(actionNode.status = "rejected"),
(actionNode.reason = error),
notifyActionListeners(actionNode),
(actionNode = actionNode.next);
while (actionNode !== last);
}
actionQueue.action = null;
}
function notifyActionListeners(actionNode) {
actionNode = actionNode.listeners;
@@ -10149,7 +10153,7 @@ var slice = Array.prototype.slice,
return null;
},
bundleType: 0,
version: "19.0.0-www-modern-67b05be0d2-20240603",
version: "19.0.0-www-modern-9598c41a20-20240603",
rendererPackageName: "react-art"
};
var internals$jscomp$inline_1357 = {
@@ -10180,7 +10184,7 @@ var internals$jscomp$inline_1357 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "19.0.0-www-modern-67b05be0d2-20240603"
reconcilerVersion: "19.0.0-www-modern-9598c41a20-20240603"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1358 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
+20 -18
View File
@@ -12972,9 +12972,16 @@ function dispatchActionState(fiber, actionQueue, setPendingState, setState, payl
throw new Error('Cannot update form state while rendering.');
}
var currentAction = actionQueue.action;
if (currentAction === null) {
// An earlier action errored. Subsequent actions should not run.
return;
}
var actionNode = {
payload: payload,
action: actionQueue.action,
action: currentAction,
next: null,
// circular
isTransition: true,
@@ -13133,28 +13140,23 @@ function onActionSuccess(actionQueue, actionNode, nextState) {
}
function onActionError(actionQueue, actionNode, error) {
actionNode.status = 'rejected';
actionNode.reason = error;
notifyActionListeners(actionNode); // Pop the action from the queue and run the next pending action, if there
// are any.
// TODO: We should instead abort all the remaining actions in the queue.
// Mark all the following actions as rejected.
var last = actionQueue.pending;
actionQueue.pending = null;
if (last !== null) {
var first = last.next;
if (first === last) {
// This was the last action in the queue.
actionQueue.pending = null;
} else {
// Remove the first node from the circular queue.
var next = first.next;
last.next = next; // Run the next action.
do {
actionNode.status = 'rejected';
actionNode.reason = error;
notifyActionListeners(actionNode);
actionNode = actionNode.next;
} while (actionNode !== first);
} // Prevent subsequent actions from being dispatched.
runActionStateAction(actionQueue, next);
}
}
actionQueue.action = null;
}
function notifyActionListeners(actionNode) {
@@ -31163,7 +31165,7 @@ identifierPrefix, onUncaughtError, onCaughtError, onRecoverableError, transition
return root;
}
var ReactVersion = '19.0.0-www-classic-67b05be0d2-20240603';
var ReactVersion = '19.0.0-www-classic-9598c41a20-20240603';
function createPortal$1(children, containerInfo, // TODO: figure out the API for cross-renderer implementation.
implementation) {
+20 -18
View File
@@ -12713,9 +12713,16 @@ function dispatchActionState(fiber, actionQueue, setPendingState, setState, payl
throw new Error('Cannot update form state while rendering.');
}
var currentAction = actionQueue.action;
if (currentAction === null) {
// An earlier action errored. Subsequent actions should not run.
return;
}
var actionNode = {
payload: payload,
action: actionQueue.action,
action: currentAction,
next: null,
// circular
isTransition: true,
@@ -12874,28 +12881,23 @@ function onActionSuccess(actionQueue, actionNode, nextState) {
}
function onActionError(actionQueue, actionNode, error) {
actionNode.status = 'rejected';
actionNode.reason = error;
notifyActionListeners(actionNode); // Pop the action from the queue and run the next pending action, if there
// are any.
// TODO: We should instead abort all the remaining actions in the queue.
// Mark all the following actions as rejected.
var last = actionQueue.pending;
actionQueue.pending = null;
if (last !== null) {
var first = last.next;
if (first === last) {
// This was the last action in the queue.
actionQueue.pending = null;
} else {
// Remove the first node from the circular queue.
var next = first.next;
last.next = next; // Run the next action.
do {
actionNode.status = 'rejected';
actionNode.reason = error;
notifyActionListeners(actionNode);
actionNode = actionNode.next;
} while (actionNode !== first);
} // Prevent subsequent actions from being dispatched.
runActionStateAction(actionQueue, next);
}
}
actionQueue.action = null;
}
function notifyActionListeners(actionNode) {
@@ -30340,7 +30342,7 @@ identifierPrefix, onUncaughtError, onCaughtError, onRecoverableError, transition
return root;
}
var ReactVersion = '19.0.0-www-modern-67b05be0d2-20240603';
var ReactVersion = '19.0.0-www-modern-9598c41a20-20240603';
function createPortal$1(children, containerInfo, // TODO: figure out the API for cross-renderer implementation.
implementation) {
+43 -39
View File
@@ -3739,29 +3739,32 @@ function dispatchActionState(
payload
) {
if (isRenderPhaseUpdate(fiber)) throw Error(formatProdErrorMessage(485));
var actionNode = {
payload: payload,
action: actionQueue.action,
next: null,
isTransition: !0,
status: "pending",
value: null,
reason: null,
listeners: [],
then: function (listener) {
actionNode.listeners.push(listener);
}
};
null !== ReactSharedInternals.T
? setPendingState(!0)
: (actionNode.isTransition = !1);
setState(actionNode);
fiber = actionQueue.pending;
null === fiber
? ((actionNode.next = actionQueue.pending = actionNode),
runActionStateAction(actionQueue, actionNode))
: ((actionNode.next = fiber.next),
(actionQueue.pending = fiber.next = actionNode));
fiber = actionQueue.action;
if (null !== fiber) {
var actionNode = {
payload: payload,
action: fiber,
next: null,
isTransition: !0,
status: "pending",
value: null,
reason: null,
listeners: [],
then: function (listener) {
actionNode.listeners.push(listener);
}
};
null !== ReactSharedInternals.T
? setPendingState(!0)
: (actionNode.isTransition = !1);
setState(actionNode);
setPendingState = actionQueue.pending;
null === setPendingState
? ((actionNode.next = actionQueue.pending = actionNode),
runActionStateAction(actionQueue, actionNode))
: ((actionNode.next = setPendingState.next),
(actionQueue.pending = setPendingState.next = actionNode));
}
}
function runActionStateAction(actionQueue, node) {
var action = node.action,
@@ -3819,17 +3822,18 @@ function onActionSuccess(actionQueue, actionNode, nextState) {
runActionStateAction(actionQueue, nextState)));
}
function onActionError(actionQueue, actionNode, error) {
actionNode.status = "rejected";
actionNode.reason = error;
notifyActionListeners(actionNode);
actionNode = actionQueue.pending;
null !== actionNode &&
((error = actionNode.next),
error === actionNode
? (actionQueue.pending = null)
: ((error = error.next),
(actionNode.next = error),
runActionStateAction(actionQueue, error)));
var last = actionQueue.pending;
actionQueue.pending = null;
if (null !== last) {
last = last.next;
do
(actionNode.status = "rejected"),
(actionNode.reason = error),
notifyActionListeners(actionNode),
(actionNode = actionNode.next);
while (actionNode !== last);
}
actionQueue.action = null;
}
function notifyActionListeners(actionNode) {
actionNode = actionNode.listeners;
@@ -17081,14 +17085,14 @@ function getCrossOriginStringAs(as, input) {
}
var isomorphicReactPackageVersion$jscomp$inline_1754 = React.version;
if (
"19.0.0-www-classic-67b05be0d2-20240603" !==
"19.0.0-www-classic-9598c41a20-20240603" !==
isomorphicReactPackageVersion$jscomp$inline_1754
)
throw Error(
formatProdErrorMessage(
527,
isomorphicReactPackageVersion$jscomp$inline_1754,
"19.0.0-www-classic-67b05be0d2-20240603"
"19.0.0-www-classic-9598c41a20-20240603"
)
);
Internals.findDOMNode = function (componentOrElement) {
@@ -17107,7 +17111,7 @@ Internals.Events = [
var devToolsConfig$jscomp$inline_1761 = {
findFiberByHostInstance: getClosestInstanceFromNode,
bundleType: 0,
version: "19.0.0-www-classic-67b05be0d2-20240603",
version: "19.0.0-www-classic-9598c41a20-20240603",
rendererPackageName: "react-dom"
};
var internals$jscomp$inline_2205 = {
@@ -17137,7 +17141,7 @@ var internals$jscomp$inline_2205 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "19.0.0-www-classic-67b05be0d2-20240603"
reconcilerVersion: "19.0.0-www-classic-9598c41a20-20240603"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_2206 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -17641,4 +17645,4 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () {
return ReactSharedInternals.H.useHostTransitionStatus();
};
exports.version = "19.0.0-www-classic-67b05be0d2-20240603";
exports.version = "19.0.0-www-classic-9598c41a20-20240603";
+43 -39
View File
@@ -3527,29 +3527,32 @@ function dispatchActionState(
payload
) {
if (isRenderPhaseUpdate(fiber)) throw Error(formatProdErrorMessage(485));
var actionNode = {
payload: payload,
action: actionQueue.action,
next: null,
isTransition: !0,
status: "pending",
value: null,
reason: null,
listeners: [],
then: function (listener) {
actionNode.listeners.push(listener);
}
};
null !== ReactSharedInternals.T
? setPendingState(!0)
: (actionNode.isTransition = !1);
setState(actionNode);
fiber = actionQueue.pending;
null === fiber
? ((actionNode.next = actionQueue.pending = actionNode),
runActionStateAction(actionQueue, actionNode))
: ((actionNode.next = fiber.next),
(actionQueue.pending = fiber.next = actionNode));
fiber = actionQueue.action;
if (null !== fiber) {
var actionNode = {
payload: payload,
action: fiber,
next: null,
isTransition: !0,
status: "pending",
value: null,
reason: null,
listeners: [],
then: function (listener) {
actionNode.listeners.push(listener);
}
};
null !== ReactSharedInternals.T
? setPendingState(!0)
: (actionNode.isTransition = !1);
setState(actionNode);
setPendingState = actionQueue.pending;
null === setPendingState
? ((actionNode.next = actionQueue.pending = actionNode),
runActionStateAction(actionQueue, actionNode))
: ((actionNode.next = setPendingState.next),
(actionQueue.pending = setPendingState.next = actionNode));
}
}
function runActionStateAction(actionQueue, node) {
var action = node.action,
@@ -3607,17 +3610,18 @@ function onActionSuccess(actionQueue, actionNode, nextState) {
runActionStateAction(actionQueue, nextState)));
}
function onActionError(actionQueue, actionNode, error) {
actionNode.status = "rejected";
actionNode.reason = error;
notifyActionListeners(actionNode);
actionNode = actionQueue.pending;
null !== actionNode &&
((error = actionNode.next),
error === actionNode
? (actionQueue.pending = null)
: ((error = error.next),
(actionNode.next = error),
runActionStateAction(actionQueue, error)));
var last = actionQueue.pending;
actionQueue.pending = null;
if (null !== last) {
last = last.next;
do
(actionNode.status = "rejected"),
(actionNode.reason = error),
notifyActionListeners(actionNode),
(actionNode = actionNode.next);
while (actionNode !== last);
}
actionQueue.action = null;
}
function notifyActionListeners(actionNode) {
actionNode = actionNode.listeners;
@@ -16444,14 +16448,14 @@ function getCrossOriginStringAs(as, input) {
}
var isomorphicReactPackageVersion$jscomp$inline_1725 = React.version;
if (
"19.0.0-www-modern-67b05be0d2-20240603" !==
"19.0.0-www-modern-9598c41a20-20240603" !==
isomorphicReactPackageVersion$jscomp$inline_1725
)
throw Error(
formatProdErrorMessage(
527,
isomorphicReactPackageVersion$jscomp$inline_1725,
"19.0.0-www-modern-67b05be0d2-20240603"
"19.0.0-www-modern-9598c41a20-20240603"
)
);
Internals.findDOMNode = function (componentOrElement) {
@@ -16470,7 +16474,7 @@ Internals.Events = [
var devToolsConfig$jscomp$inline_1727 = {
findFiberByHostInstance: getClosestInstanceFromNode,
bundleType: 0,
version: "19.0.0-www-modern-67b05be0d2-20240603",
version: "19.0.0-www-modern-9598c41a20-20240603",
rendererPackageName: "react-dom"
};
var internals$jscomp$inline_2196 = {
@@ -16500,7 +16504,7 @@ var internals$jscomp$inline_2196 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "19.0.0-www-modern-67b05be0d2-20240603"
reconcilerVersion: "19.0.0-www-modern-9598c41a20-20240603"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_2197 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -16874,4 +16878,4 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () {
return ReactSharedInternals.H.useHostTransitionStatus();
};
exports.version = "19.0.0-www-modern-67b05be0d2-20240603";
exports.version = "19.0.0-www-modern-9598c41a20-20240603";
@@ -3875,29 +3875,32 @@ function dispatchActionState(
payload
) {
if (isRenderPhaseUpdate(fiber)) throw Error(formatProdErrorMessage(485));
var actionNode = {
payload: payload,
action: actionQueue.action,
next: null,
isTransition: !0,
status: "pending",
value: null,
reason: null,
listeners: [],
then: function (listener) {
actionNode.listeners.push(listener);
}
};
null !== ReactSharedInternals.T
? setPendingState(!0)
: (actionNode.isTransition = !1);
setState(actionNode);
fiber = actionQueue.pending;
null === fiber
? ((actionNode.next = actionQueue.pending = actionNode),
runActionStateAction(actionQueue, actionNode))
: ((actionNode.next = fiber.next),
(actionQueue.pending = fiber.next = actionNode));
fiber = actionQueue.action;
if (null !== fiber) {
var actionNode = {
payload: payload,
action: fiber,
next: null,
isTransition: !0,
status: "pending",
value: null,
reason: null,
listeners: [],
then: function (listener) {
actionNode.listeners.push(listener);
}
};
null !== ReactSharedInternals.T
? setPendingState(!0)
: (actionNode.isTransition = !1);
setState(actionNode);
setPendingState = actionQueue.pending;
null === setPendingState
? ((actionNode.next = actionQueue.pending = actionNode),
runActionStateAction(actionQueue, actionNode))
: ((actionNode.next = setPendingState.next),
(actionQueue.pending = setPendingState.next = actionNode));
}
}
function runActionStateAction(actionQueue, node) {
var action = node.action,
@@ -3955,17 +3958,18 @@ function onActionSuccess(actionQueue, actionNode, nextState) {
runActionStateAction(actionQueue, nextState)));
}
function onActionError(actionQueue, actionNode, error) {
actionNode.status = "rejected";
actionNode.reason = error;
notifyActionListeners(actionNode);
actionNode = actionQueue.pending;
null !== actionNode &&
((error = actionNode.next),
error === actionNode
? (actionQueue.pending = null)
: ((error = error.next),
(actionNode.next = error),
runActionStateAction(actionQueue, error)));
var last = actionQueue.pending;
actionQueue.pending = null;
if (null !== last) {
last = last.next;
do
(actionNode.status = "rejected"),
(actionNode.reason = error),
notifyActionListeners(actionNode),
(actionNode = actionNode.next);
while (actionNode !== last);
}
actionQueue.action = null;
}
function notifyActionListeners(actionNode) {
actionNode = actionNode.listeners;
@@ -17848,14 +17852,14 @@ function getCrossOriginStringAs(as, input) {
}
var isomorphicReactPackageVersion$jscomp$inline_1841 = React.version;
if (
"19.0.0-www-classic-67b05be0d2-20240603" !==
"19.0.0-www-classic-9598c41a20-20240603" !==
isomorphicReactPackageVersion$jscomp$inline_1841
)
throw Error(
formatProdErrorMessage(
527,
isomorphicReactPackageVersion$jscomp$inline_1841,
"19.0.0-www-classic-67b05be0d2-20240603"
"19.0.0-www-classic-9598c41a20-20240603"
)
);
Internals.findDOMNode = function (componentOrElement) {
@@ -17874,7 +17878,7 @@ Internals.Events = [
var devToolsConfig$jscomp$inline_1848 = {
findFiberByHostInstance: getClosestInstanceFromNode,
bundleType: 0,
version: "19.0.0-www-classic-67b05be0d2-20240603",
version: "19.0.0-www-classic-9598c41a20-20240603",
rendererPackageName: "react-dom"
};
(function (internals) {
@@ -17918,7 +17922,7 @@ var devToolsConfig$jscomp$inline_1848 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "19.0.0-www-classic-67b05be0d2-20240603"
reconcilerVersion: "19.0.0-www-classic-9598c41a20-20240603"
});
function ReactDOMRoot(internalRoot) {
this._internalRoot = internalRoot;
@@ -18409,7 +18413,7 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () {
return ReactSharedInternals.H.useHostTransitionStatus();
};
exports.version = "19.0.0-www-classic-67b05be0d2-20240603";
exports.version = "19.0.0-www-classic-9598c41a20-20240603";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
@@ -3663,29 +3663,32 @@ function dispatchActionState(
payload
) {
if (isRenderPhaseUpdate(fiber)) throw Error(formatProdErrorMessage(485));
var actionNode = {
payload: payload,
action: actionQueue.action,
next: null,
isTransition: !0,
status: "pending",
value: null,
reason: null,
listeners: [],
then: function (listener) {
actionNode.listeners.push(listener);
}
};
null !== ReactSharedInternals.T
? setPendingState(!0)
: (actionNode.isTransition = !1);
setState(actionNode);
fiber = actionQueue.pending;
null === fiber
? ((actionNode.next = actionQueue.pending = actionNode),
runActionStateAction(actionQueue, actionNode))
: ((actionNode.next = fiber.next),
(actionQueue.pending = fiber.next = actionNode));
fiber = actionQueue.action;
if (null !== fiber) {
var actionNode = {
payload: payload,
action: fiber,
next: null,
isTransition: !0,
status: "pending",
value: null,
reason: null,
listeners: [],
then: function (listener) {
actionNode.listeners.push(listener);
}
};
null !== ReactSharedInternals.T
? setPendingState(!0)
: (actionNode.isTransition = !1);
setState(actionNode);
setPendingState = actionQueue.pending;
null === setPendingState
? ((actionNode.next = actionQueue.pending = actionNode),
runActionStateAction(actionQueue, actionNode))
: ((actionNode.next = setPendingState.next),
(actionQueue.pending = setPendingState.next = actionNode));
}
}
function runActionStateAction(actionQueue, node) {
var action = node.action,
@@ -3743,17 +3746,18 @@ function onActionSuccess(actionQueue, actionNode, nextState) {
runActionStateAction(actionQueue, nextState)));
}
function onActionError(actionQueue, actionNode, error) {
actionNode.status = "rejected";
actionNode.reason = error;
notifyActionListeners(actionNode);
actionNode = actionQueue.pending;
null !== actionNode &&
((error = actionNode.next),
error === actionNode
? (actionQueue.pending = null)
: ((error = error.next),
(actionNode.next = error),
runActionStateAction(actionQueue, error)));
var last = actionQueue.pending;
actionQueue.pending = null;
if (null !== last) {
last = last.next;
do
(actionNode.status = "rejected"),
(actionNode.reason = error),
notifyActionListeners(actionNode),
(actionNode = actionNode.next);
while (actionNode !== last);
}
actionQueue.action = null;
}
function notifyActionListeners(actionNode) {
actionNode = actionNode.listeners;
@@ -17194,14 +17198,14 @@ function getCrossOriginStringAs(as, input) {
}
var isomorphicReactPackageVersion$jscomp$inline_1812 = React.version;
if (
"19.0.0-www-modern-67b05be0d2-20240603" !==
"19.0.0-www-modern-9598c41a20-20240603" !==
isomorphicReactPackageVersion$jscomp$inline_1812
)
throw Error(
formatProdErrorMessage(
527,
isomorphicReactPackageVersion$jscomp$inline_1812,
"19.0.0-www-modern-67b05be0d2-20240603"
"19.0.0-www-modern-9598c41a20-20240603"
)
);
Internals.findDOMNode = function (componentOrElement) {
@@ -17220,7 +17224,7 @@ Internals.Events = [
var devToolsConfig$jscomp$inline_1814 = {
findFiberByHostInstance: getClosestInstanceFromNode,
bundleType: 0,
version: "19.0.0-www-modern-67b05be0d2-20240603",
version: "19.0.0-www-modern-9598c41a20-20240603",
rendererPackageName: "react-dom"
};
(function (internals) {
@@ -17264,7 +17268,7 @@ var devToolsConfig$jscomp$inline_1814 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "19.0.0-www-modern-67b05be0d2-20240603"
reconcilerVersion: "19.0.0-www-modern-9598c41a20-20240603"
});
function ReactDOMRoot(internalRoot) {
this._internalRoot = internalRoot;
@@ -17625,7 +17629,7 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () {
return ReactSharedInternals.H.useHostTransitionStatus();
};
exports.version = "19.0.0-www-modern-67b05be0d2-20240603";
exports.version = "19.0.0-www-modern-9598c41a20-20240603";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
@@ -19,7 +19,7 @@ if (__DEV__) {
var React = require('react');
var ReactDOM = require('react-dom');
var ReactVersion = '19.0.0-www-classic-67b05be0d2-20240603';
var ReactVersion = '19.0.0-www-classic-9598c41a20-20240603';
// This refers to a WWW module.
var warningWWW = require('warning');
@@ -19,7 +19,7 @@ if (__DEV__) {
var React = require('react');
var ReactDOM = require('react-dom');
var ReactVersion = '19.0.0-www-modern-67b05be0d2-20240603';
var ReactVersion = '19.0.0-www-modern-9598c41a20-20240603';
// This refers to a WWW module.
var warningWWW = require('warning');
@@ -5699,4 +5699,4 @@ exports.renderToString = function (children, options) {
'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server'
);
};
exports.version = "19.0.0-www-classic-67b05be0d2-20240603";
exports.version = "19.0.0-www-classic-9598c41a20-20240603";
@@ -5677,4 +5677,4 @@ exports.renderToString = function (children, options) {
'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server'
);
};
exports.version = "19.0.0-www-modern-67b05be0d2-20240603";
exports.version = "19.0.0-www-modern-9598c41a20-20240603";
@@ -13113,9 +13113,16 @@ function dispatchActionState(fiber, actionQueue, setPendingState, setState, payl
throw new Error('Cannot update form state while rendering.');
}
var currentAction = actionQueue.action;
if (currentAction === null) {
// An earlier action errored. Subsequent actions should not run.
return;
}
var actionNode = {
payload: payload,
action: actionQueue.action,
action: currentAction,
next: null,
// circular
isTransition: true,
@@ -13274,28 +13281,23 @@ function onActionSuccess(actionQueue, actionNode, nextState) {
}
function onActionError(actionQueue, actionNode, error) {
actionNode.status = 'rejected';
actionNode.reason = error;
notifyActionListeners(actionNode); // Pop the action from the queue and run the next pending action, if there
// are any.
// TODO: We should instead abort all the remaining actions in the queue.
// Mark all the following actions as rejected.
var last = actionQueue.pending;
actionQueue.pending = null;
if (last !== null) {
var first = last.next;
if (first === last) {
// This was the last action in the queue.
actionQueue.pending = null;
} else {
// Remove the first node from the circular queue.
var next = first.next;
last.next = next; // Run the next action.
do {
actionNode.status = 'rejected';
actionNode.reason = error;
notifyActionListeners(actionNode);
actionNode = actionNode.next;
} while (actionNode !== first);
} // Prevent subsequent actions from being dispatched.
runActionStateAction(actionQueue, next);
}
}
actionQueue.action = null;
}
function notifyActionListeners(actionNode) {
@@ -31729,7 +31731,7 @@ identifierPrefix, onUncaughtError, onCaughtError, onRecoverableError, transition
return root;
}
var ReactVersion = '19.0.0-www-classic-67b05be0d2-20240603';
var ReactVersion = '19.0.0-www-classic-9598c41a20-20240603';
function createPortal$1(children, containerInfo, // TODO: figure out the API for cross-renderer implementation.
implementation) {
@@ -12854,9 +12854,16 @@ function dispatchActionState(fiber, actionQueue, setPendingState, setState, payl
throw new Error('Cannot update form state while rendering.');
}
var currentAction = actionQueue.action;
if (currentAction === null) {
// An earlier action errored. Subsequent actions should not run.
return;
}
var actionNode = {
payload: payload,
action: actionQueue.action,
action: currentAction,
next: null,
// circular
isTransition: true,
@@ -13015,28 +13022,23 @@ function onActionSuccess(actionQueue, actionNode, nextState) {
}
function onActionError(actionQueue, actionNode, error) {
actionNode.status = 'rejected';
actionNode.reason = error;
notifyActionListeners(actionNode); // Pop the action from the queue and run the next pending action, if there
// are any.
// TODO: We should instead abort all the remaining actions in the queue.
// Mark all the following actions as rejected.
var last = actionQueue.pending;
actionQueue.pending = null;
if (last !== null) {
var first = last.next;
if (first === last) {
// This was the last action in the queue.
actionQueue.pending = null;
} else {
// Remove the first node from the circular queue.
var next = first.next;
last.next = next; // Run the next action.
do {
actionNode.status = 'rejected';
actionNode.reason = error;
notifyActionListeners(actionNode);
actionNode = actionNode.next;
} while (actionNode !== first);
} // Prevent subsequent actions from being dispatched.
runActionStateAction(actionQueue, next);
}
}
actionQueue.action = null;
}
function notifyActionListeners(actionNode) {
@@ -30906,7 +30908,7 @@ identifierPrefix, onUncaughtError, onCaughtError, onRecoverableError, transition
return root;
}
var ReactVersion = '19.0.0-www-modern-67b05be0d2-20240603';
var ReactVersion = '19.0.0-www-modern-9598c41a20-20240603';
function createPortal$1(children, containerInfo, // TODO: figure out the API for cross-renderer implementation.
implementation) {
@@ -3825,29 +3825,32 @@ function dispatchActionState(
payload
) {
if (isRenderPhaseUpdate(fiber)) throw Error(formatProdErrorMessage(485));
var actionNode = {
payload: payload,
action: actionQueue.action,
next: null,
isTransition: !0,
status: "pending",
value: null,
reason: null,
listeners: [],
then: function (listener) {
actionNode.listeners.push(listener);
}
};
null !== ReactSharedInternals.T
? setPendingState(!0)
: (actionNode.isTransition = !1);
setState(actionNode);
fiber = actionQueue.pending;
null === fiber
? ((actionNode.next = actionQueue.pending = actionNode),
runActionStateAction(actionQueue, actionNode))
: ((actionNode.next = fiber.next),
(actionQueue.pending = fiber.next = actionNode));
fiber = actionQueue.action;
if (null !== fiber) {
var actionNode = {
payload: payload,
action: fiber,
next: null,
isTransition: !0,
status: "pending",
value: null,
reason: null,
listeners: [],
then: function (listener) {
actionNode.listeners.push(listener);
}
};
null !== ReactSharedInternals.T
? setPendingState(!0)
: (actionNode.isTransition = !1);
setState(actionNode);
setPendingState = actionQueue.pending;
null === setPendingState
? ((actionNode.next = actionQueue.pending = actionNode),
runActionStateAction(actionQueue, actionNode))
: ((actionNode.next = setPendingState.next),
(actionQueue.pending = setPendingState.next = actionNode));
}
}
function runActionStateAction(actionQueue, node) {
var action = node.action,
@@ -3905,17 +3908,18 @@ function onActionSuccess(actionQueue, actionNode, nextState) {
runActionStateAction(actionQueue, nextState)));
}
function onActionError(actionQueue, actionNode, error) {
actionNode.status = "rejected";
actionNode.reason = error;
notifyActionListeners(actionNode);
actionNode = actionQueue.pending;
null !== actionNode &&
((error = actionNode.next),
error === actionNode
? (actionQueue.pending = null)
: ((error = error.next),
(actionNode.next = error),
runActionStateAction(actionQueue, error)));
var last = actionQueue.pending;
actionQueue.pending = null;
if (null !== last) {
last = last.next;
do
(actionNode.status = "rejected"),
(actionNode.reason = error),
notifyActionListeners(actionNode),
(actionNode = actionNode.next);
while (actionNode !== last);
}
actionQueue.action = null;
}
function notifyActionListeners(actionNode) {
actionNode = actionNode.listeners;
@@ -17410,14 +17414,14 @@ function getCrossOriginStringAs(as, input) {
}
var isomorphicReactPackageVersion$jscomp$inline_1784 = React.version;
if (
"19.0.0-www-classic-67b05be0d2-20240603" !==
"19.0.0-www-classic-9598c41a20-20240603" !==
isomorphicReactPackageVersion$jscomp$inline_1784
)
throw Error(
formatProdErrorMessage(
527,
isomorphicReactPackageVersion$jscomp$inline_1784,
"19.0.0-www-classic-67b05be0d2-20240603"
"19.0.0-www-classic-9598c41a20-20240603"
)
);
Internals.findDOMNode = function (componentOrElement) {
@@ -17436,7 +17440,7 @@ Internals.Events = [
var devToolsConfig$jscomp$inline_1791 = {
findFiberByHostInstance: getClosestInstanceFromNode,
bundleType: 0,
version: "19.0.0-www-classic-67b05be0d2-20240603",
version: "19.0.0-www-classic-9598c41a20-20240603",
rendererPackageName: "react-dom"
};
var internals$jscomp$inline_2240 = {
@@ -17466,7 +17470,7 @@ var internals$jscomp$inline_2240 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "19.0.0-www-classic-67b05be0d2-20240603"
reconcilerVersion: "19.0.0-www-classic-9598c41a20-20240603"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_2241 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -18121,4 +18125,4 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () {
return ReactSharedInternals.H.useHostTransitionStatus();
};
exports.version = "19.0.0-www-classic-67b05be0d2-20240603";
exports.version = "19.0.0-www-classic-9598c41a20-20240603";
@@ -3672,29 +3672,32 @@ function dispatchActionState(
payload
) {
if (isRenderPhaseUpdate(fiber)) throw Error(formatProdErrorMessage(485));
var actionNode = {
payload: payload,
action: actionQueue.action,
next: null,
isTransition: !0,
status: "pending",
value: null,
reason: null,
listeners: [],
then: function (listener) {
actionNode.listeners.push(listener);
}
};
null !== ReactSharedInternals.T
? setPendingState(!0)
: (actionNode.isTransition = !1);
setState(actionNode);
fiber = actionQueue.pending;
null === fiber
? ((actionNode.next = actionQueue.pending = actionNode),
runActionStateAction(actionQueue, actionNode))
: ((actionNode.next = fiber.next),
(actionQueue.pending = fiber.next = actionNode));
fiber = actionQueue.action;
if (null !== fiber) {
var actionNode = {
payload: payload,
action: fiber,
next: null,
isTransition: !0,
status: "pending",
value: null,
reason: null,
listeners: [],
then: function (listener) {
actionNode.listeners.push(listener);
}
};
null !== ReactSharedInternals.T
? setPendingState(!0)
: (actionNode.isTransition = !1);
setState(actionNode);
setPendingState = actionQueue.pending;
null === setPendingState
? ((actionNode.next = actionQueue.pending = actionNode),
runActionStateAction(actionQueue, actionNode))
: ((actionNode.next = setPendingState.next),
(actionQueue.pending = setPendingState.next = actionNode));
}
}
function runActionStateAction(actionQueue, node) {
var action = node.action,
@@ -3752,17 +3755,18 @@ function onActionSuccess(actionQueue, actionNode, nextState) {
runActionStateAction(actionQueue, nextState)));
}
function onActionError(actionQueue, actionNode, error) {
actionNode.status = "rejected";
actionNode.reason = error;
notifyActionListeners(actionNode);
actionNode = actionQueue.pending;
null !== actionNode &&
((error = actionNode.next),
error === actionNode
? (actionQueue.pending = null)
: ((error = error.next),
(actionNode.next = error),
runActionStateAction(actionQueue, error)));
var last = actionQueue.pending;
actionQueue.pending = null;
if (null !== last) {
last = last.next;
do
(actionNode.status = "rejected"),
(actionNode.reason = error),
notifyActionListeners(actionNode),
(actionNode = actionNode.next);
while (actionNode !== last);
}
actionQueue.action = null;
}
function notifyActionListeners(actionNode) {
actionNode = actionNode.listeners;
@@ -16832,14 +16836,14 @@ function getCrossOriginStringAs(as, input) {
}
var isomorphicReactPackageVersion$jscomp$inline_1755 = React.version;
if (
"19.0.0-www-modern-67b05be0d2-20240603" !==
"19.0.0-www-modern-9598c41a20-20240603" !==
isomorphicReactPackageVersion$jscomp$inline_1755
)
throw Error(
formatProdErrorMessage(
527,
isomorphicReactPackageVersion$jscomp$inline_1755,
"19.0.0-www-modern-67b05be0d2-20240603"
"19.0.0-www-modern-9598c41a20-20240603"
)
);
Internals.findDOMNode = function (componentOrElement) {
@@ -16858,7 +16862,7 @@ Internals.Events = [
var devToolsConfig$jscomp$inline_1757 = {
findFiberByHostInstance: getClosestInstanceFromNode,
bundleType: 0,
version: "19.0.0-www-modern-67b05be0d2-20240603",
version: "19.0.0-www-modern-9598c41a20-20240603",
rendererPackageName: "react-dom"
};
var internals$jscomp$inline_2231 = {
@@ -16888,7 +16892,7 @@ var internals$jscomp$inline_2231 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "19.0.0-www-modern-67b05be0d2-20240603"
reconcilerVersion: "19.0.0-www-modern-9598c41a20-20240603"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_2232 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -17413,4 +17417,4 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () {
return ReactSharedInternals.H.useHostTransitionStatus();
};
exports.version = "19.0.0-www-modern-67b05be0d2-20240603";
exports.version = "19.0.0-www-modern-9598c41a20-20240603";
@@ -9873,9 +9873,16 @@ function dispatchActionState(fiber, actionQueue, setPendingState, setState, payl
throw new Error('Cannot update form state while rendering.');
}
var currentAction = actionQueue.action;
if (currentAction === null) {
// An earlier action errored. Subsequent actions should not run.
return;
}
var actionNode = {
payload: payload,
action: actionQueue.action,
action: currentAction,
next: null,
// circular
isTransition: true,
@@ -10034,28 +10041,23 @@ function onActionSuccess(actionQueue, actionNode, nextState) {
}
function onActionError(actionQueue, actionNode, error) {
actionNode.status = 'rejected';
actionNode.reason = error;
notifyActionListeners(actionNode); // Pop the action from the queue and run the next pending action, if there
// are any.
// TODO: We should instead abort all the remaining actions in the queue.
// Mark all the following actions as rejected.
var last = actionQueue.pending;
actionQueue.pending = null;
if (last !== null) {
var first = last.next;
if (first === last) {
// This was the last action in the queue.
actionQueue.pending = null;
} else {
// Remove the first node from the circular queue.
var next = first.next;
last.next = next; // Run the next action.
do {
actionNode.status = 'rejected';
actionNode.reason = error;
notifyActionListeners(actionNode);
actionNode = actionNode.next;
} while (actionNode !== first);
} // Prevent subsequent actions from being dispatched.
runActionStateAction(actionQueue, next);
}
}
actionQueue.action = null;
}
function notifyActionListeners(actionNode) {
@@ -28931,7 +28933,7 @@ identifierPrefix, onUncaughtError, onCaughtError, onRecoverableError, transition
return root;
}
var ReactVersion = '19.0.0-www-classic-67b05be0d2-20240603';
var ReactVersion = '19.0.0-www-classic-9598c41a20-20240603';
/*
* The `'' + value` pattern (used in perf-sensitive code) throws for Symbol
@@ -9664,9 +9664,16 @@ function dispatchActionState(fiber, actionQueue, setPendingState, setState, payl
throw new Error('Cannot update form state while rendering.');
}
var currentAction = actionQueue.action;
if (currentAction === null) {
// An earlier action errored. Subsequent actions should not run.
return;
}
var actionNode = {
payload: payload,
action: actionQueue.action,
action: currentAction,
next: null,
// circular
isTransition: true,
@@ -9825,28 +9832,23 @@ function onActionSuccess(actionQueue, actionNode, nextState) {
}
function onActionError(actionQueue, actionNode, error) {
actionNode.status = 'rejected';
actionNode.reason = error;
notifyActionListeners(actionNode); // Pop the action from the queue and run the next pending action, if there
// are any.
// TODO: We should instead abort all the remaining actions in the queue.
// Mark all the following actions as rejected.
var last = actionQueue.pending;
actionQueue.pending = null;
if (last !== null) {
var first = last.next;
if (first === last) {
// This was the last action in the queue.
actionQueue.pending = null;
} else {
// Remove the first node from the circular queue.
var next = first.next;
last.next = next; // Run the next action.
do {
actionNode.status = 'rejected';
actionNode.reason = error;
notifyActionListeners(actionNode);
actionNode = actionNode.next;
} while (actionNode !== first);
} // Prevent subsequent actions from being dispatched.
runActionStateAction(actionQueue, next);
}
}
actionQueue.action = null;
}
function notifyActionListeners(actionNode) {
@@ -28199,7 +28201,7 @@ identifierPrefix, onUncaughtError, onCaughtError, onRecoverableError, transition
return root;
}
var ReactVersion = '19.0.0-www-modern-67b05be0d2-20240603';
var ReactVersion = '19.0.0-www-modern-9598c41a20-20240603';
/*
* The `'' + value` pattern (used in perf-sensitive code) throws for Symbol
@@ -2881,29 +2881,32 @@ module.exports = function ($$$config) {
payload
) {
if (isRenderPhaseUpdate(fiber)) throw Error(formatProdErrorMessage(485));
var actionNode = {
payload: payload,
action: actionQueue.action,
next: null,
isTransition: !0,
status: "pending",
value: null,
reason: null,
listeners: [],
then: function (listener) {
actionNode.listeners.push(listener);
}
};
null !== ReactSharedInternals.T
? setPendingState(!0)
: (actionNode.isTransition = !1);
setState(actionNode);
fiber = actionQueue.pending;
null === fiber
? ((actionNode.next = actionQueue.pending = actionNode),
runActionStateAction(actionQueue, actionNode))
: ((actionNode.next = fiber.next),
(actionQueue.pending = fiber.next = actionNode));
fiber = actionQueue.action;
if (null !== fiber) {
var actionNode = {
payload: payload,
action: fiber,
next: null,
isTransition: !0,
status: "pending",
value: null,
reason: null,
listeners: [],
then: function (listener) {
actionNode.listeners.push(listener);
}
};
null !== ReactSharedInternals.T
? setPendingState(!0)
: (actionNode.isTransition = !1);
setState(actionNode);
setPendingState = actionQueue.pending;
null === setPendingState
? ((actionNode.next = actionQueue.pending = actionNode),
runActionStateAction(actionQueue, actionNode))
: ((actionNode.next = setPendingState.next),
(actionQueue.pending = setPendingState.next = actionNode));
}
}
function runActionStateAction(actionQueue, node) {
var action = node.action,
@@ -2961,17 +2964,18 @@ module.exports = function ($$$config) {
runActionStateAction(actionQueue, nextState)));
}
function onActionError(actionQueue, actionNode, error) {
actionNode.status = "rejected";
actionNode.reason = error;
notifyActionListeners(actionNode);
actionNode = actionQueue.pending;
null !== actionNode &&
((error = actionNode.next),
error === actionNode
? (actionQueue.pending = null)
: ((error = error.next),
(actionNode.next = error),
runActionStateAction(actionQueue, error)));
var last = actionQueue.pending;
actionQueue.pending = null;
if (null !== last) {
last = last.next;
do
(actionNode.status = "rejected"),
(actionNode.reason = error),
notifyActionListeners(actionNode),
(actionNode = actionNode.next);
while (actionNode !== last);
}
actionQueue.action = null;
}
function notifyActionListeners(actionNode) {
actionNode = actionNode.listeners;
@@ -12661,7 +12665,7 @@ module.exports = function ($$$config) {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "19.0.0-www-classic-67b05be0d2-20240603"
reconcilerVersion: "19.0.0-www-classic-9598c41a20-20240603"
};
if ("undefined" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)
devToolsConfig = !1;
@@ -2741,29 +2741,32 @@ module.exports = function ($$$config) {
payload
) {
if (isRenderPhaseUpdate(fiber)) throw Error(formatProdErrorMessage(485));
var actionNode = {
payload: payload,
action: actionQueue.action,
next: null,
isTransition: !0,
status: "pending",
value: null,
reason: null,
listeners: [],
then: function (listener) {
actionNode.listeners.push(listener);
}
};
null !== ReactSharedInternals.T
? setPendingState(!0)
: (actionNode.isTransition = !1);
setState(actionNode);
fiber = actionQueue.pending;
null === fiber
? ((actionNode.next = actionQueue.pending = actionNode),
runActionStateAction(actionQueue, actionNode))
: ((actionNode.next = fiber.next),
(actionQueue.pending = fiber.next = actionNode));
fiber = actionQueue.action;
if (null !== fiber) {
var actionNode = {
payload: payload,
action: fiber,
next: null,
isTransition: !0,
status: "pending",
value: null,
reason: null,
listeners: [],
then: function (listener) {
actionNode.listeners.push(listener);
}
};
null !== ReactSharedInternals.T
? setPendingState(!0)
: (actionNode.isTransition = !1);
setState(actionNode);
setPendingState = actionQueue.pending;
null === setPendingState
? ((actionNode.next = actionQueue.pending = actionNode),
runActionStateAction(actionQueue, actionNode))
: ((actionNode.next = setPendingState.next),
(actionQueue.pending = setPendingState.next = actionNode));
}
}
function runActionStateAction(actionQueue, node) {
var action = node.action,
@@ -2821,17 +2824,18 @@ module.exports = function ($$$config) {
runActionStateAction(actionQueue, nextState)));
}
function onActionError(actionQueue, actionNode, error) {
actionNode.status = "rejected";
actionNode.reason = error;
notifyActionListeners(actionNode);
actionNode = actionQueue.pending;
null !== actionNode &&
((error = actionNode.next),
error === actionNode
? (actionQueue.pending = null)
: ((error = error.next),
(actionNode.next = error),
runActionStateAction(actionQueue, error)));
var last = actionQueue.pending;
actionQueue.pending = null;
if (null !== last) {
last = last.next;
do
(actionNode.status = "rejected"),
(actionNode.reason = error),
notifyActionListeners(actionNode),
(actionNode = actionNode.next);
while (actionNode !== last);
}
actionQueue.action = null;
}
function notifyActionListeners(actionNode) {
actionNode = actionNode.listeners;
@@ -12174,7 +12178,7 @@ module.exports = function ($$$config) {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "19.0.0-www-modern-67b05be0d2-20240603"
reconcilerVersion: "19.0.0-www-modern-9598c41a20-20240603"
};
if ("undefined" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)
devToolsConfig = !1;
@@ -8403,9 +8403,16 @@ function dispatchActionState(fiber, actionQueue, setPendingState, setState, payl
throw new Error('Cannot update form state while rendering.');
}
var currentAction = actionQueue.action;
if (currentAction === null) {
// An earlier action errored. Subsequent actions should not run.
return;
}
var actionNode = {
payload: payload,
action: actionQueue.action,
action: currentAction,
next: null,
// circular
isTransition: true,
@@ -8564,28 +8571,23 @@ function onActionSuccess(actionQueue, actionNode, nextState) {
}
function onActionError(actionQueue, actionNode, error) {
actionNode.status = 'rejected';
actionNode.reason = error;
notifyActionListeners(actionNode); // Pop the action from the queue and run the next pending action, if there
// are any.
// TODO: We should instead abort all the remaining actions in the queue.
// Mark all the following actions as rejected.
var last = actionQueue.pending;
actionQueue.pending = null;
if (last !== null) {
var first = last.next;
if (first === last) {
// This was the last action in the queue.
actionQueue.pending = null;
} else {
// Remove the first node from the circular queue.
var next = first.next;
last.next = next; // Run the next action.
do {
actionNode.status = 'rejected';
actionNode.reason = error;
notifyActionListeners(actionNode);
actionNode = actionNode.next;
} while (actionNode !== first);
} // Prevent subsequent actions from being dispatched.
runActionStateAction(actionQueue, next);
}
}
actionQueue.action = null;
}
function notifyActionListeners(actionNode) {
@@ -23410,7 +23412,7 @@ identifierPrefix, onUncaughtError, onCaughtError, onRecoverableError, transition
return root;
}
var ReactVersion = '19.0.0-www-classic-67b05be0d2-20240603';
var ReactVersion = '19.0.0-www-classic-9598c41a20-20240603';
/*
* The `'' + value` pattern (used in perf-sensitive code) throws for Symbol
@@ -8403,9 +8403,16 @@ function dispatchActionState(fiber, actionQueue, setPendingState, setState, payl
throw new Error('Cannot update form state while rendering.');
}
var currentAction = actionQueue.action;
if (currentAction === null) {
// An earlier action errored. Subsequent actions should not run.
return;
}
var actionNode = {
payload: payload,
action: actionQueue.action,
action: currentAction,
next: null,
// circular
isTransition: true,
@@ -8564,28 +8571,23 @@ function onActionSuccess(actionQueue, actionNode, nextState) {
}
function onActionError(actionQueue, actionNode, error) {
actionNode.status = 'rejected';
actionNode.reason = error;
notifyActionListeners(actionNode); // Pop the action from the queue and run the next pending action, if there
// are any.
// TODO: We should instead abort all the remaining actions in the queue.
// Mark all the following actions as rejected.
var last = actionQueue.pending;
actionQueue.pending = null;
if (last !== null) {
var first = last.next;
if (first === last) {
// This was the last action in the queue.
actionQueue.pending = null;
} else {
// Remove the first node from the circular queue.
var next = first.next;
last.next = next; // Run the next action.
do {
actionNode.status = 'rejected';
actionNode.reason = error;
notifyActionListeners(actionNode);
actionNode = actionNode.next;
} while (actionNode !== first);
} // Prevent subsequent actions from being dispatched.
runActionStateAction(actionQueue, next);
}
}
actionQueue.action = null;
}
function notifyActionListeners(actionNode) {
@@ -23410,7 +23412,7 @@ identifierPrefix, onUncaughtError, onCaughtError, onRecoverableError, transition
return root;
}
var ReactVersion = '19.0.0-www-modern-67b05be0d2-20240603';
var ReactVersion = '19.0.0-www-modern-9598c41a20-20240603';
/*
* The `'' + value` pattern (used in perf-sensitive code) throws for Symbol
+1 -1
View File
@@ -1 +1 @@
19.0.0-www-classic-67b05be0d2-20240603
19.0.0-www-classic-9598c41a20-20240603
+1 -1
View File
@@ -1 +1 @@
19.0.0-www-modern-67b05be0d2-20240603
19.0.0-www-modern-9598c41a20-20240603