Skip to content

Commit

Permalink
Clarify useActionState async non-transition warning (#32207)
Browse files Browse the repository at this point in the history
#28491 (comment)

DiffTrain build for [b65afdd](b65afdd)
  • Loading branch information
sophiebits committed Jan 24, 2025
1 parent 7ab02f1 commit a88abd3
Show file tree
Hide file tree
Showing 23 changed files with 91 additions and 91 deletions.
2 changes: 1 addition & 1 deletion compiled-rn/VERSION_NATIVE_FB
Original file line number Diff line number Diff line change
@@ -1 +1 @@
19.1.0-native-fb-028c8e6c-20250121
19.1.0-native-fb-b65afdd0-20250124
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<196643d457b7976a620753cc80271271>>
* @generated SignedSource<<f86a149ff967387732d4233e07747d36>>
*/

"use strict";
Expand Down Expand Up @@ -428,5 +428,5 @@ __DEV__ &&
exports.useFormStatus = function () {
return resolveDispatcher().useHostTransitionStatus();
};
exports.version = "19.1.0-native-fb-028c8e6c-20250121";
exports.version = "19.1.0-native-fb-b65afdd0-20250124";
})();
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<00d882adfafb6d1a9627beb598263fa8>>
* @generated SignedSource<<d555752c449cd18ecbdfd3e8cee0f299>>
*/

"use strict";
Expand Down Expand Up @@ -203,4 +203,4 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () {
return ReactSharedInternals.H.useHostTransitionStatus();
};
exports.version = "19.1.0-native-fb-028c8e6c-20250121";
exports.version = "19.1.0-native-fb-b65afdd0-20250124";
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<00d882adfafb6d1a9627beb598263fa8>>
* @generated SignedSource<<d555752c449cd18ecbdfd3e8cee0f299>>
*/

"use strict";
Expand Down Expand Up @@ -203,4 +203,4 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () {
return ReactSharedInternals.H.useHostTransitionStatus();
};
exports.version = "19.1.0-native-fb-028c8e6c-20250121";
exports.version = "19.1.0-native-fb-b65afdd0-20250124";
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<7e27dad790bbcabadfdb7af782fa0c42>>
* @generated SignedSource<<baeae2570277ef1966b0d12de09d2b22>>
*/

/*
Expand Down Expand Up @@ -6270,7 +6270,7 @@ __DEV__ &&
),
node.isTransition ||
error$jscomp$0(
"An async function was passed to useActionState, but it was dispatched outside of an action context. This is likely not what you intended. Either pass the dispatch function to an `action` prop, or dispatch manually inside `startTransition`"
"An async function with useActionState was called outside of a transition. This is likely not what you intended (for example, isPending will not update correctly). Either call the returned function inside startTransition, or pass it to an `action` or `formAction` prop."
))
: onActionSuccess(actionQueue, node, returnValue);
}
Expand Down Expand Up @@ -25957,11 +25957,11 @@ __DEV__ &&
};
(function () {
var isomorphicReactPackageVersion = React.version;
if ("19.1.0-native-fb-028c8e6c-20250121" !== isomorphicReactPackageVersion)
if ("19.1.0-native-fb-b65afdd0-20250124" !== isomorphicReactPackageVersion)
throw Error(
'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' +
(isomorphicReactPackageVersion +
"\n - react-dom: 19.1.0-native-fb-028c8e6c-20250121\nLearn more: https://react.dev/warnings/version-mismatch")
"\n - react-dom: 19.1.0-native-fb-b65afdd0-20250124\nLearn more: https://react.dev/warnings/version-mismatch")
);
})();
("function" === typeof Map &&
Expand Down Expand Up @@ -25998,10 +25998,10 @@ __DEV__ &&
!(function () {
var internals = {
bundleType: 1,
version: "19.1.0-native-fb-028c8e6c-20250121",
version: "19.1.0-native-fb-b65afdd0-20250124",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-native-fb-028c8e6c-20250121"
reconcilerVersion: "19.1.0-native-fb-b65afdd0-20250124"
};
internals.overrideHookState = overrideHookState;
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
Expand Down Expand Up @@ -26147,5 +26147,5 @@ __DEV__ &&
listenToAllSupportedEvents(container);
return new ReactDOMHydrationRoot(initialChildren);
};
exports.version = "19.1.0-native-fb-028c8e6c-20250121";
exports.version = "19.1.0-native-fb-b65afdd0-20250124";
})();
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<b58e5efc1912dfa86b64057623e9bd9b>>
* @generated SignedSource<<fbce17dbf10019f688b903e340d81493>>
*/

/*
Expand Down Expand Up @@ -15968,14 +15968,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) {
};
var isomorphicReactPackageVersion$jscomp$inline_1785 = React.version;
if (
"19.1.0-native-fb-028c8e6c-20250121" !==
"19.1.0-native-fb-b65afdd0-20250124" !==
isomorphicReactPackageVersion$jscomp$inline_1785
)
throw Error(
formatProdErrorMessage(
527,
isomorphicReactPackageVersion$jscomp$inline_1785,
"19.1.0-native-fb-028c8e6c-20250121"
"19.1.0-native-fb-b65afdd0-20250124"
)
);
ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
Expand All @@ -15997,10 +15997,10 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
};
var internals$jscomp$inline_2241 = {
bundleType: 0,
version: "19.1.0-native-fb-028c8e6c-20250121",
version: "19.1.0-native-fb-b65afdd0-20250124",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-native-fb-028c8e6c-20250121"
reconcilerVersion: "19.1.0-native-fb-b65afdd0-20250124"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_2242 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down Expand Up @@ -16106,4 +16106,4 @@ exports.hydrateRoot = function (container, initialChildren, options) {
listenToAllSupportedEvents(container);
return new ReactDOMHydrationRoot(initialChildren);
};
exports.version = "19.1.0-native-fb-028c8e6c-20250121";
exports.version = "19.1.0-native-fb-b65afdd0-20250124";
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<26c5c9bcaf4f9c963a355c567fee66e7>>
* @generated SignedSource<<25cb6adf5eeca922c17401515bf4a2c5>>
*/

/*
Expand Down Expand Up @@ -16617,14 +16617,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) {
};
var isomorphicReactPackageVersion$jscomp$inline_1880 = React.version;
if (
"19.1.0-native-fb-028c8e6c-20250121" !==
"19.1.0-native-fb-b65afdd0-20250124" !==
isomorphicReactPackageVersion$jscomp$inline_1880
)
throw Error(
formatProdErrorMessage(
527,
isomorphicReactPackageVersion$jscomp$inline_1880,
"19.1.0-native-fb-028c8e6c-20250121"
"19.1.0-native-fb-b65afdd0-20250124"
)
);
ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
Expand All @@ -16646,10 +16646,10 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
};
var internals$jscomp$inline_1887 = {
bundleType: 0,
version: "19.1.0-native-fb-028c8e6c-20250121",
version: "19.1.0-native-fb-b65afdd0-20250124",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-native-fb-028c8e6c-20250121",
reconcilerVersion: "19.1.0-native-fb-b65afdd0-20250124",
getLaneLabelMap: function () {
for (
var map = new Map(), lane = 1, index$292 = 0;
Expand Down Expand Up @@ -16770,4 +16770,4 @@ exports.hydrateRoot = function (container, initialChildren, options) {
listenToAllSupportedEvents(container);
return new ReactDOMHydrationRoot(initialChildren);
};
exports.version = "19.1.0-native-fb-028c8e6c-20250121";
exports.version = "19.1.0-native-fb-b65afdd0-20250124";
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<00a5a33095096e7adddb3fdaeea26c8d>>
* @generated SignedSource<<28e1ae0e704a3d0f18caa0f827720417>>
*/

/*
Expand Down Expand Up @@ -6278,7 +6278,7 @@ __DEV__ &&
),
node.isTransition ||
error$jscomp$0(
"An async function was passed to useActionState, but it was dispatched outside of an action context. This is likely not what you intended. Either pass the dispatch function to an `action` prop, or dispatch manually inside `startTransition`"
"An async function with useActionState was called outside of a transition. This is likely not what you intended (for example, isPending will not update correctly). Either call the returned function inside startTransition, or pass it to an `action` or `formAction` prop."
))
: onActionSuccess(actionQueue, node, returnValue);
}
Expand Down Expand Up @@ -26018,11 +26018,11 @@ __DEV__ &&
};
(function () {
var isomorphicReactPackageVersion = React.version;
if ("19.1.0-native-fb-028c8e6c-20250121" !== isomorphicReactPackageVersion)
if ("19.1.0-native-fb-b65afdd0-20250124" !== isomorphicReactPackageVersion)
throw Error(
'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' +
(isomorphicReactPackageVersion +
"\n - react-dom: 19.1.0-native-fb-028c8e6c-20250121\nLearn more: https://react.dev/warnings/version-mismatch")
"\n - react-dom: 19.1.0-native-fb-b65afdd0-20250124\nLearn more: https://react.dev/warnings/version-mismatch")
);
})();
("function" === typeof Map &&
Expand Down Expand Up @@ -26059,10 +26059,10 @@ __DEV__ &&
!(function () {
var internals = {
bundleType: 1,
version: "19.1.0-native-fb-028c8e6c-20250121",
version: "19.1.0-native-fb-b65afdd0-20250124",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-native-fb-028c8e6c-20250121"
reconcilerVersion: "19.1.0-native-fb-b65afdd0-20250124"
};
internals.overrideHookState = overrideHookState;
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
Expand Down Expand Up @@ -26524,7 +26524,7 @@ __DEV__ &&
exports.useFormStatus = function () {
return resolveDispatcher().useHostTransitionStatus();
};
exports.version = "19.1.0-native-fb-028c8e6c-20250121";
exports.version = "19.1.0-native-fb-b65afdd0-20250124";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<20122955dd5629d8d1ab88d6929c9020>>
* @generated SignedSource<<fbf76f944ce7eb32a37ce046a1cfb88d>>
*/

/*
Expand Down Expand Up @@ -15979,14 +15979,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) {
};
var isomorphicReactPackageVersion$jscomp$inline_1786 = React.version;
if (
"19.1.0-native-fb-028c8e6c-20250121" !==
"19.1.0-native-fb-b65afdd0-20250124" !==
isomorphicReactPackageVersion$jscomp$inline_1786
)
throw Error(
formatProdErrorMessage(
527,
isomorphicReactPackageVersion$jscomp$inline_1786,
"19.1.0-native-fb-028c8e6c-20250121"
"19.1.0-native-fb-b65afdd0-20250124"
)
);
ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
Expand All @@ -16008,10 +16008,10 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
};
var internals$jscomp$inline_2244 = {
bundleType: 0,
version: "19.1.0-native-fb-028c8e6c-20250121",
version: "19.1.0-native-fb-b65afdd0-20250124",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-native-fb-028c8e6c-20250121"
reconcilerVersion: "19.1.0-native-fb-b65afdd0-20250124"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_2245 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down Expand Up @@ -16271,4 +16271,4 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () {
return ReactSharedInternals.H.useHostTransitionStatus();
};
exports.version = "19.1.0-native-fb-028c8e6c-20250121";
exports.version = "19.1.0-native-fb-b65afdd0-20250124";
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<cf448d1f28418996d1b2d128e2cfb847>>
* @generated SignedSource<<45fa11d45d96b5c877c9d6e02960001e>>
*/

/*
Expand Down Expand Up @@ -16632,14 +16632,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) {
};
var isomorphicReactPackageVersion$jscomp$inline_1881 = React.version;
if (
"19.1.0-native-fb-028c8e6c-20250121" !==
"19.1.0-native-fb-b65afdd0-20250124" !==
isomorphicReactPackageVersion$jscomp$inline_1881
)
throw Error(
formatProdErrorMessage(
527,
isomorphicReactPackageVersion$jscomp$inline_1881,
"19.1.0-native-fb-028c8e6c-20250121"
"19.1.0-native-fb-b65afdd0-20250124"
)
);
ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
Expand All @@ -16661,10 +16661,10 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
};
var internals$jscomp$inline_1888 = {
bundleType: 0,
version: "19.1.0-native-fb-028c8e6c-20250121",
version: "19.1.0-native-fb-b65afdd0-20250124",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-native-fb-028c8e6c-20250121",
reconcilerVersion: "19.1.0-native-fb-b65afdd0-20250124",
getLaneLabelMap: function () {
for (
var map = new Map(), lane = 1, index$292 = 0;
Expand Down Expand Up @@ -16939,7 +16939,7 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () {
return ReactSharedInternals.H.useHostTransitionStatus();
};
exports.version = "19.1.0-native-fb-028c8e6c-20250121";
exports.version = "19.1.0-native-fb-b65afdd0-20250124";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<2d8cd148450da6868c62026b7639f3d4>>
* @generated SignedSource<<c5ca48df42c7919ea3fa5e57845e79d9>>
*/

"use strict";
Expand Down Expand Up @@ -3691,7 +3691,7 @@ __DEV__ &&
),
node.isTransition ||
error$jscomp$0(
"An async function was passed to useActionState, but it was dispatched outside of an action context. This is likely not what you intended. Either pass the dispatch function to an `action` prop, or dispatch manually inside `startTransition`"
"An async function with useActionState was called outside of a transition. This is likely not what you intended (for example, isPending will not update correctly). Either call the returned function inside startTransition, or pass it to an `action` or `formAction` prop."
))
: onActionSuccess(actionQueue, node, returnValue);
}
Expand Down Expand Up @@ -15644,10 +15644,10 @@ __DEV__ &&
(function () {
var internals = {
bundleType: 1,
version: "19.1.0-native-fb-028c8e6c-20250121",
version: "19.1.0-native-fb-b65afdd0-20250124",
rendererPackageName: "react-test-renderer",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-native-fb-028c8e6c-20250121"
reconcilerVersion: "19.1.0-native-fb-b65afdd0-20250124"
};
internals.overrideHookState = overrideHookState;
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
Expand Down Expand Up @@ -15792,5 +15792,5 @@ __DEV__ &&
flushSyncWorkAcrossRoots_impl(0, !0));
}
};
exports.version = "19.1.0-native-fb-028c8e6c-20250121";
exports.version = "19.1.0-native-fb-b65afdd0-20250124";
})();
Loading

0 comments on commit a88abd3

Please sign in to comment.