[eslint] Disallow use within try/catch blocks (#34040)

Follow up to #34032. The linter now ensures that `use` cannot be used
within try/catch.

DiffTrain build for [820af20971](https://github.com/facebook/react/commit/820af2097103309fdc5675d2bde744103a439eff)
This commit is contained in:
poteto
2025-07-29 09:40:25 -07:00
parent fad31e901a
commit d75704db4e
26 changed files with 119 additions and 89 deletions
+1 -1
View File
@@ -1 +1 @@
19.2.0-native-fb-9be531cd-20250729
19.2.0-native-fb-820af209-20250729
@@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<61185d542c129be47371da0352cb6dba>>
* @generated SignedSource<<f8b21cc24ef053773a5ef2c759dae2f0>>
*/
"use strict";
@@ -404,5 +404,5 @@ __DEV__ &&
exports.useFormStatus = function () {
return resolveDispatcher().useHostTransitionStatus();
};
exports.version = "19.2.0-native-fb-9be531cd-20250729";
exports.version = "19.2.0-native-fb-820af209-20250729";
})();
@@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<84636765ccb52c0b590bfd7a8025b0dd>>
* @generated SignedSource<<46937cfe16e9375fcbab25ac47ade8fa>>
*/
"use strict";
@@ -203,4 +203,4 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () {
return ReactSharedInternals.H.useHostTransitionStatus();
};
exports.version = "19.2.0-native-fb-9be531cd-20250729";
exports.version = "19.2.0-native-fb-820af209-20250729";
@@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<84636765ccb52c0b590bfd7a8025b0dd>>
* @generated SignedSource<<46937cfe16e9375fcbab25ac47ade8fa>>
*/
"use strict";
@@ -203,4 +203,4 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () {
return ReactSharedInternals.H.useHostTransitionStatus();
};
exports.version = "19.2.0-native-fb-9be531cd-20250729";
exports.version = "19.2.0-native-fb-820af209-20250729";
@@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<437184afd2011127714d49b733bba695>>
* @generated SignedSource<<91d9be576ed43f59bff4948bc07117cd>>
*/
/*
@@ -29025,11 +29025,11 @@ __DEV__ &&
};
(function () {
var isomorphicReactPackageVersion = React.version;
if ("19.2.0-native-fb-9be531cd-20250729" !== isomorphicReactPackageVersion)
if ("19.2.0-native-fb-820af209-20250729" !== 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.2.0-native-fb-9be531cd-20250729\nLearn more: https://react.dev/warnings/version-mismatch")
"\n - react-dom: 19.2.0-native-fb-820af209-20250729\nLearn more: https://react.dev/warnings/version-mismatch")
);
})();
("function" === typeof Map &&
@@ -29066,10 +29066,10 @@ __DEV__ &&
!(function () {
var internals = {
bundleType: 1,
version: "19.2.0-native-fb-9be531cd-20250729",
version: "19.2.0-native-fb-820af209-20250729",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.2.0-native-fb-9be531cd-20250729"
reconcilerVersion: "19.2.0-native-fb-820af209-20250729"
};
internals.overrideHookState = overrideHookState;
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -29207,5 +29207,5 @@ __DEV__ &&
listenToAllSupportedEvents(container);
return new ReactDOMHydrationRoot(initialChildren);
};
exports.version = "19.2.0-native-fb-9be531cd-20250729";
exports.version = "19.2.0-native-fb-820af209-20250729";
})();
@@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<c7743635ed7df7643b55be3df1aebea6>>
* @generated SignedSource<<e366c3e46a53c1662f5bdc9a8c87d96e>>
*/
/*
@@ -17128,14 +17128,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) {
};
var isomorphicReactPackageVersion$jscomp$inline_2002 = React.version;
if (
"19.2.0-native-fb-9be531cd-20250729" !==
"19.2.0-native-fb-820af209-20250729" !==
isomorphicReactPackageVersion$jscomp$inline_2002
)
throw Error(
formatProdErrorMessage(
527,
isomorphicReactPackageVersion$jscomp$inline_2002,
"19.2.0-native-fb-9be531cd-20250729"
"19.2.0-native-fb-820af209-20250729"
)
);
ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
@@ -17157,10 +17157,10 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
};
var internals$jscomp$inline_2521 = {
bundleType: 0,
version: "19.2.0-native-fb-9be531cd-20250729",
version: "19.2.0-native-fb-820af209-20250729",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.2.0-native-fb-9be531cd-20250729"
reconcilerVersion: "19.2.0-native-fb-820af209-20250729"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_2522 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -17258,4 +17258,4 @@ exports.hydrateRoot = function (container, initialChildren, options) {
listenToAllSupportedEvents(container);
return new ReactDOMHydrationRoot(initialChildren);
};
exports.version = "19.2.0-native-fb-9be531cd-20250729";
exports.version = "19.2.0-native-fb-820af209-20250729";
@@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<761b086f8673833ba8b00d132b06292e>>
* @generated SignedSource<<5980f6f5028e7c9045cdca30e9cafb43>>
*/
/*
@@ -19086,14 +19086,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) {
};
var isomorphicReactPackageVersion$jscomp$inline_2242 = React.version;
if (
"19.2.0-native-fb-9be531cd-20250729" !==
"19.2.0-native-fb-820af209-20250729" !==
isomorphicReactPackageVersion$jscomp$inline_2242
)
throw Error(
formatProdErrorMessage(
527,
isomorphicReactPackageVersion$jscomp$inline_2242,
"19.2.0-native-fb-9be531cd-20250729"
"19.2.0-native-fb-820af209-20250729"
)
);
ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
@@ -19115,10 +19115,10 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
};
var internals$jscomp$inline_2249 = {
bundleType: 0,
version: "19.2.0-native-fb-9be531cd-20250729",
version: "19.2.0-native-fb-820af209-20250729",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.2.0-native-fb-9be531cd-20250729",
reconcilerVersion: "19.2.0-native-fb-820af209-20250729",
getLaneLabelMap: function () {
for (
var map = new Map(), lane = 1, index$319 = 0;
@@ -19231,4 +19231,4 @@ exports.hydrateRoot = function (container, initialChildren, options) {
listenToAllSupportedEvents(container);
return new ReactDOMHydrationRoot(initialChildren);
};
exports.version = "19.2.0-native-fb-9be531cd-20250729";
exports.version = "19.2.0-native-fb-820af209-20250729";
@@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<5431658016686f769daaae99fc9d0523>>
* @generated SignedSource<<bbdf930a69a50b79d8fa605ff1c68bc4>>
*/
/*
@@ -29081,11 +29081,11 @@ __DEV__ &&
};
(function () {
var isomorphicReactPackageVersion = React.version;
if ("19.2.0-native-fb-9be531cd-20250729" !== isomorphicReactPackageVersion)
if ("19.2.0-native-fb-820af209-20250729" !== 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.2.0-native-fb-9be531cd-20250729\nLearn more: https://react.dev/warnings/version-mismatch")
"\n - react-dom: 19.2.0-native-fb-820af209-20250729\nLearn more: https://react.dev/warnings/version-mismatch")
);
})();
("function" === typeof Map &&
@@ -29122,10 +29122,10 @@ __DEV__ &&
!(function () {
var internals = {
bundleType: 1,
version: "19.2.0-native-fb-9be531cd-20250729",
version: "19.2.0-native-fb-820af209-20250729",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.2.0-native-fb-9be531cd-20250729"
reconcilerVersion: "19.2.0-native-fb-820af209-20250729"
};
internals.overrideHookState = overrideHookState;
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -29579,7 +29579,7 @@ __DEV__ &&
exports.useFormStatus = function () {
return resolveDispatcher().useHostTransitionStatus();
};
exports.version = "19.2.0-native-fb-9be531cd-20250729";
exports.version = "19.2.0-native-fb-820af209-20250729";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
@@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<7a32532458cd1f332d97f03b39d8d53d>>
* @generated SignedSource<<8057e42a1ec2c22c5081229d0e39d384>>
*/
/*
@@ -17139,14 +17139,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) {
};
var isomorphicReactPackageVersion$jscomp$inline_2003 = React.version;
if (
"19.2.0-native-fb-9be531cd-20250729" !==
"19.2.0-native-fb-820af209-20250729" !==
isomorphicReactPackageVersion$jscomp$inline_2003
)
throw Error(
formatProdErrorMessage(
527,
isomorphicReactPackageVersion$jscomp$inline_2003,
"19.2.0-native-fb-9be531cd-20250729"
"19.2.0-native-fb-820af209-20250729"
)
);
ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
@@ -17168,10 +17168,10 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
};
var internals$jscomp$inline_2524 = {
bundleType: 0,
version: "19.2.0-native-fb-9be531cd-20250729",
version: "19.2.0-native-fb-820af209-20250729",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.2.0-native-fb-9be531cd-20250729"
reconcilerVersion: "19.2.0-native-fb-820af209-20250729"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_2525 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -17422,4 +17422,4 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () {
return ReactSharedInternals.H.useHostTransitionStatus();
};
exports.version = "19.2.0-native-fb-9be531cd-20250729";
exports.version = "19.2.0-native-fb-820af209-20250729";
@@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<9d678eede77593c91104e77824ff2c35>>
* @generated SignedSource<<d0242a2d8574d8b55d6bc2b60d5093b3>>
*/
/*
@@ -19101,14 +19101,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) {
};
var isomorphicReactPackageVersion$jscomp$inline_2243 = React.version;
if (
"19.2.0-native-fb-9be531cd-20250729" !==
"19.2.0-native-fb-820af209-20250729" !==
isomorphicReactPackageVersion$jscomp$inline_2243
)
throw Error(
formatProdErrorMessage(
527,
isomorphicReactPackageVersion$jscomp$inline_2243,
"19.2.0-native-fb-9be531cd-20250729"
"19.2.0-native-fb-820af209-20250729"
)
);
ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
@@ -19130,10 +19130,10 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
};
var internals$jscomp$inline_2250 = {
bundleType: 0,
version: "19.2.0-native-fb-9be531cd-20250729",
version: "19.2.0-native-fb-820af209-20250729",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.2.0-native-fb-9be531cd-20250729",
reconcilerVersion: "19.2.0-native-fb-820af209-20250729",
getLaneLabelMap: function () {
for (
var map = new Map(), lane = 1, index$319 = 0;
@@ -19399,7 +19399,7 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () {
return ReactSharedInternals.H.useHostTransitionStatus();
};
exports.version = "19.2.0-native-fb-9be531cd-20250729";
exports.version = "19.2.0-native-fb-820af209-20250729";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
@@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<48de369f266e09314ffce50f84c74731>>
* @generated SignedSource<<06e15cce0fbb51605bf2c52e5fd1a10e>>
*/
"use strict";
@@ -15739,10 +15739,10 @@ __DEV__ &&
(function () {
var internals = {
bundleType: 1,
version: "19.2.0-native-fb-9be531cd-20250729",
version: "19.2.0-native-fb-820af209-20250729",
rendererPackageName: "react-test-renderer",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.2.0-native-fb-9be531cd-20250729"
reconcilerVersion: "19.2.0-native-fb-820af209-20250729"
};
internals.overrideHookState = overrideHookState;
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -15887,5 +15887,5 @@ __DEV__ &&
flushSyncWorkAcrossRoots_impl(0, !0));
}
};
exports.version = "19.2.0-native-fb-9be531cd-20250729";
exports.version = "19.2.0-native-fb-820af209-20250729";
})();
@@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<9617ba5946a3698efcad1bbbfed6c93d>>
* @generated SignedSource<<015208ef78918d562897d73054076a4b>>
*/
"use strict";
@@ -9912,10 +9912,10 @@ function wrapFiber(fiber) {
}
var internals$jscomp$inline_1432 = {
bundleType: 0,
version: "19.2.0-native-fb-9be531cd-20250729",
version: "19.2.0-native-fb-820af209-20250729",
rendererPackageName: "react-test-renderer",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.2.0-native-fb-9be531cd-20250729"
reconcilerVersion: "19.2.0-native-fb-820af209-20250729"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1433 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -10051,4 +10051,4 @@ exports.unstable_batchedUpdates = function (fn, a) {
flushSyncWorkAcrossRoots_impl(0, !0));
}
};
exports.version = "19.2.0-native-fb-9be531cd-20250729";
exports.version = "19.2.0-native-fb-820af209-20250729";
@@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<681b7382921839151b617eb3569f4418>>
* @generated SignedSource<<76e116028ef547cb39c66055a1b7e355>>
*/
"use strict";
@@ -10532,10 +10532,10 @@ function wrapFiber(fiber) {
}
var internals$jscomp$inline_1239 = {
bundleType: 0,
version: "19.2.0-native-fb-9be531cd-20250729",
version: "19.2.0-native-fb-820af209-20250729",
rendererPackageName: "react-test-renderer",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.2.0-native-fb-9be531cd-20250729",
reconcilerVersion: "19.2.0-native-fb-820af209-20250729",
getLaneLabelMap: function () {
for (
var map = new Map(), lane = 1, index$143 = 0;
@@ -10686,4 +10686,4 @@ exports.unstable_batchedUpdates = function (fn, a) {
flushSyncWorkAcrossRoots_impl(0, !0));
}
};
exports.version = "19.2.0-native-fb-9be531cd-20250729";
exports.version = "19.2.0-native-fb-820af209-20250729";
@@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<94c7eced9d07db1c46411db98828041b>>
* @generated SignedSource<<72e22e14f261075efa4b5eb0864e3c50>>
*/
"use strict";
@@ -1413,7 +1413,7 @@ __DEV__ &&
exports.useTransition = function () {
return resolveDispatcher().useTransition();
};
exports.version = "19.2.0-native-fb-9be531cd-20250729";
exports.version = "19.2.0-native-fb-820af209-20250729";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
@@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<3b62fec781eb5ea5b169c107b0841137>>
* @generated SignedSource<<fc953626ea149eb81d3bb925771e113b>>
*/
"use strict";
@@ -589,4 +589,4 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
};
exports.version = "19.2.0-native-fb-9be531cd-20250729";
exports.version = "19.2.0-native-fb-820af209-20250729";
@@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<20f5becac85859c7b0dddeb21d15d8e2>>
* @generated SignedSource<<5f904bf639f54e3722635a1b2ef98a14>>
*/
"use strict";
@@ -593,7 +593,7 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
};
exports.version = "19.2.0-native-fb-9be531cd-20250729";
exports.version = "19.2.0-native-fb-820af209-20250729";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
@@ -1 +1 @@
9be531cd37f5558c72f7de360eb921b0074e8544
820af2097103309fdc5675d2bde744103a439eff
@@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<dcf074954dabccfbdae28b3edc8d84af>>
* @generated SignedSource<<8bc4b7fa6141d6a69563d35596f2d067>>
*/
"use strict";
@@ -19244,10 +19244,10 @@ __DEV__ &&
(function () {
var internals = {
bundleType: 1,
version: "19.2.0-native-fb-9be531cd-20250729",
version: "19.2.0-native-fb-820af209-20250729",
rendererPackageName: "react-native-renderer",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.2.0-native-fb-9be531cd-20250729"
reconcilerVersion: "19.2.0-native-fb-820af209-20250729"
};
null !== extraDevToolsConfig &&
(internals.rendererConfig = extraDevToolsConfig);
@@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<e68d126cf37c58ad8e127c2a69760f0c>>
* @generated SignedSource<<f231881363c96f69868487731c99972c>>
*/
"use strict";
@@ -11016,10 +11016,10 @@ batchedUpdatesImpl = function (fn, a) {
var roots = new Map(),
internals$jscomp$inline_1235 = {
bundleType: 0,
version: "19.2.0-native-fb-9be531cd-20250729",
version: "19.2.0-native-fb-820af209-20250729",
rendererPackageName: "react-native-renderer",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.2.0-native-fb-9be531cd-20250729"
reconcilerVersion: "19.2.0-native-fb-820af209-20250729"
};
null !== extraDevToolsConfig &&
(internals$jscomp$inline_1235.rendererConfig = extraDevToolsConfig);
@@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<bf9a51ae9bf61b741d8b71abebad8b96>>
* @generated SignedSource<<2433c6dec5b26d625605939bbb83ef05>>
*/
"use strict";
@@ -12945,10 +12945,10 @@ batchedUpdatesImpl = function (fn, a) {
var roots = new Map(),
internals$jscomp$inline_1470 = {
bundleType: 0,
version: "19.2.0-native-fb-9be531cd-20250729",
version: "19.2.0-native-fb-820af209-20250729",
rendererPackageName: "react-native-renderer",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.2.0-native-fb-9be531cd-20250729"
reconcilerVersion: "19.2.0-native-fb-820af209-20250729"
};
null !== extraDevToolsConfig &&
(internals$jscomp$inline_1470.rendererConfig = extraDevToolsConfig);
@@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<c8e234da5a71fd50fe846287260d42ed>>
* @generated SignedSource<<bd7a27936c9578f35af9608e7d5709cf>>
*/
"use strict";
@@ -19602,11 +19602,11 @@ __DEV__ &&
shouldSuspendImpl = newShouldSuspendImpl;
};
var isomorphicReactPackageVersion = React.version;
if ("19.2.0-native-fb-9be531cd-20250729" !== isomorphicReactPackageVersion)
if ("19.2.0-native-fb-820af209-20250729" !== isomorphicReactPackageVersion)
throw Error(
'Incompatible React versions: The "react" and "react-native-renderer" packages must have the exact same version. Instead got:\n - react: ' +
(isomorphicReactPackageVersion +
"\n - react-native-renderer: 19.2.0-native-fb-9be531cd-20250729\nLearn more: https://react.dev/warnings/version-mismatch")
"\n - react-native-renderer: 19.2.0-native-fb-820af209-20250729\nLearn more: https://react.dev/warnings/version-mismatch")
);
if (
"function" !==
@@ -19632,10 +19632,10 @@ __DEV__ &&
(function () {
var internals = {
bundleType: 1,
version: "19.2.0-native-fb-9be531cd-20250729",
version: "19.2.0-native-fb-820af209-20250729",
rendererPackageName: "react-native-renderer",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.2.0-native-fb-9be531cd-20250729"
reconcilerVersion: "19.2.0-native-fb-820af209-20250729"
};
null !== extraDevToolsConfig &&
(internals.rendererConfig = extraDevToolsConfig);
@@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<1a99f34e5519dcc8c66cff6cb8c79135>>
* @generated SignedSource<<1ceb537de194199d61177d5006fc095b>>
*/
"use strict";
@@ -11242,11 +11242,11 @@ function updateContainer(element, container, parentComponent, callback) {
return lane;
}
var isomorphicReactPackageVersion = React.version;
if ("19.2.0-native-fb-9be531cd-20250729" !== isomorphicReactPackageVersion)
if ("19.2.0-native-fb-820af209-20250729" !== isomorphicReactPackageVersion)
throw Error(
'Incompatible React versions: The "react" and "react-native-renderer" packages must have the exact same version. Instead got:\n - react: ' +
(isomorphicReactPackageVersion +
"\n - react-native-renderer: 19.2.0-native-fb-9be531cd-20250729\nLearn more: https://react.dev/warnings/version-mismatch")
"\n - react-native-renderer: 19.2.0-native-fb-820af209-20250729\nLearn more: https://react.dev/warnings/version-mismatch")
);
if (
"function" !==
@@ -11296,10 +11296,10 @@ batchedUpdatesImpl = function (fn, a) {
var roots = new Map(),
internals$jscomp$inline_1293 = {
bundleType: 0,
version: "19.2.0-native-fb-9be531cd-20250729",
version: "19.2.0-native-fb-820af209-20250729",
rendererPackageName: "react-native-renderer",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.2.0-native-fb-9be531cd-20250729"
reconcilerVersion: "19.2.0-native-fb-820af209-20250729"
};
null !== extraDevToolsConfig &&
(internals$jscomp$inline_1293.rendererConfig = extraDevToolsConfig);
@@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<a983d833ea3baf7d9b564e1dacf1e2c0>>
* @generated SignedSource<<136e26ae541ba78d142337cefd57066c>>
*/
"use strict";
@@ -13160,11 +13160,11 @@ function updateContainer(element, container, parentComponent, callback) {
return lane;
}
var isomorphicReactPackageVersion = React.version;
if ("19.2.0-native-fb-9be531cd-20250729" !== isomorphicReactPackageVersion)
if ("19.2.0-native-fb-820af209-20250729" !== isomorphicReactPackageVersion)
throw Error(
'Incompatible React versions: The "react" and "react-native-renderer" packages must have the exact same version. Instead got:\n - react: ' +
(isomorphicReactPackageVersion +
"\n - react-native-renderer: 19.2.0-native-fb-9be531cd-20250729\nLearn more: https://react.dev/warnings/version-mismatch")
"\n - react-native-renderer: 19.2.0-native-fb-820af209-20250729\nLearn more: https://react.dev/warnings/version-mismatch")
);
if (
"function" !==
@@ -13214,10 +13214,10 @@ batchedUpdatesImpl = function (fn, a) {
var roots = new Map(),
internals$jscomp$inline_1528 = {
bundleType: 0,
version: "19.2.0-native-fb-9be531cd-20250729",
version: "19.2.0-native-fb-820af209-20250729",
rendererPackageName: "react-native-renderer",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.2.0-native-fb-9be531cd-20250729"
reconcilerVersion: "19.2.0-native-fb-820af209-20250729"
};
null !== extraDevToolsConfig &&
(internals$jscomp$inline_1528.rendererConfig = extraDevToolsConfig);
@@ -12,7 +12,7 @@
* @lightSyntaxTransform
* @preventMunge
* @oncall react_core
* @generated SignedSource<<a47b8848ba2f41a3a5bf4b93518b6c18>>
* @generated SignedSource<<82fead294e1b0b5fcb96ef9cf7e4af9b>>
*/
'use strict';
@@ -55796,6 +55796,15 @@ function isInsideDoWhileLoop(node) {
}
return false;
}
function isInsideTryCatch(node) {
while (node) {
if (node.type === 'TryStatement' || node.type === 'CatchClause') {
return true;
}
node = node.parent;
}
return false;
}
function isUseEffectEventIdentifier(node) {
{
return node.type === 'Identifier' && node.name === 'useEffectEvent';
@@ -55999,6 +56008,12 @@ const rule = {
if (hasFlowSuppression(hook, 'react-rule-hook')) {
continue;
}
if (isUseIdentifier(hook) && isInsideTryCatch(hook)) {
context.report({
node: hook,
message: `React Hook "${getSourceCode().getText(hook)}" cannot be called in a try/catch block.`,
});
}
if ((cycled || isInsideDoWhileLoop(hook)) &&
!isUseIdentifier(hook)) {
context.report({
@@ -6,7 +6,7 @@
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
* @generated SignedSource<<97679be2952d86c2d3eb0c5b32ce41e9>>
* @generated SignedSource<<db1aa5f446193cc65773bb48a6e1b8ec>>
*/
'use strict';
@@ -55575,6 +55575,15 @@ function isInsideDoWhileLoop(node) {
}
return false;
}
function isInsideTryCatch(node) {
while (node) {
if (node.type === 'TryStatement' || node.type === 'CatchClause') {
return true;
}
node = node.parent;
}
return false;
}
function isUseEffectEventIdentifier(node) {
{
return node.type === 'Identifier' && node.name === 'useEffectEvent';
@@ -55778,6 +55787,12 @@ const rule = {
if (hasFlowSuppression(hook, 'react-rule-hook')) {
continue;
}
if (isUseIdentifier(hook) && isInsideTryCatch(hook)) {
context.report({
node: hook,
message: `React Hook "${getSourceCode().getText(hook)}" cannot be called in a try/catch block.`,
});
}
if ((cycled || isInsideDoWhileLoop(hook)) &&
!isUseIdentifier(hook)) {
context.report({
@@ -1,7 +1,7 @@
{
"name": "eslint-plugin-react-hooks",
"description": "ESLint rules for React Hooks",
"version": "0.0.0-experimental-9be531cd-20250729",
"version": "0.0.0-experimental-820af209-20250729",
"repository": {
"type": "git",
"url": "https://github.com/facebook/react.git",