mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
[ESLint] Disallow passing effect event down when inlined as a prop (#34820)
## Summary
Fixes https://github.com/facebook/react/issues/34793.
We are allowing passing down effect events when they are inlined as a
prop.
```
<Child onClick={useEffectEvent(...)} />
```
This seems like a case that someone not familiar with `useEffectEvent`'s
purpose could fall for so this PR introduces logic to disallow its
usage.
An alternative implementation would be to modify the name and function
of `recordAllUseEffectEventFunctions` to record all `useEffectEvent`
instances either assigned to a variable or not, but this seems clearer.
Or we could also specifically disallow its usage inside JSX. Feel free
to suggest any improvements.
## How did you test this change?
- Added a new test in
`packages/eslint-plugin-react-hooks/__tests__/ESLintRulesOfHooks-test.js`.
All tests pass.
DiffTrain build for [2381ecc290](https://github.com/facebook/react/commit/2381ecc290c588f6366bdcf377529668bb3cc360)
This commit is contained in:
@@ -1 +1 @@
|
||||
19.3.0-native-fb-ed1351c4-20251016
|
||||
19.3.0-native-fb-2381ecc2-20251016
|
||||
Vendored
+2
-2
@@ -7,7 +7,7 @@
|
||||
* @noflow
|
||||
* @nolint
|
||||
* @preventMunge
|
||||
* @generated SignedSource<<0c3973912050f59d94122963d1d2deda>>
|
||||
* @generated SignedSource<<02f85e09338414dec512e969ccef61b4>>
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
@@ -404,5 +404,5 @@ __DEV__ &&
|
||||
exports.useFormStatus = function () {
|
||||
return resolveDispatcher().useHostTransitionStatus();
|
||||
};
|
||||
exports.version = "19.3.0-native-fb-ed1351c4-20251016";
|
||||
exports.version = "19.3.0-native-fb-2381ecc2-20251016";
|
||||
})();
|
||||
|
||||
Vendored
+2
-2
@@ -7,7 +7,7 @@
|
||||
* @noflow
|
||||
* @nolint
|
||||
* @preventMunge
|
||||
* @generated SignedSource<<b6536d265de7b2c1f98d4b5c5631182a>>
|
||||
* @generated SignedSource<<2762d016addc7ef4be11b0622e0ed14c>>
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
@@ -203,4 +203,4 @@ exports.useFormState = function (action, initialState, permalink) {
|
||||
exports.useFormStatus = function () {
|
||||
return ReactSharedInternals.H.useHostTransitionStatus();
|
||||
};
|
||||
exports.version = "19.3.0-native-fb-ed1351c4-20251016";
|
||||
exports.version = "19.3.0-native-fb-2381ecc2-20251016";
|
||||
|
||||
Vendored
+2
-2
@@ -7,7 +7,7 @@
|
||||
* @noflow
|
||||
* @nolint
|
||||
* @preventMunge
|
||||
* @generated SignedSource<<b6536d265de7b2c1f98d4b5c5631182a>>
|
||||
* @generated SignedSource<<2762d016addc7ef4be11b0622e0ed14c>>
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
@@ -203,4 +203,4 @@ exports.useFormState = function (action, initialState, permalink) {
|
||||
exports.useFormStatus = function () {
|
||||
return ReactSharedInternals.H.useHostTransitionStatus();
|
||||
};
|
||||
exports.version = "19.3.0-native-fb-ed1351c4-20251016";
|
||||
exports.version = "19.3.0-native-fb-2381ecc2-20251016";
|
||||
|
||||
Vendored
+6
-6
@@ -7,7 +7,7 @@
|
||||
* @noflow
|
||||
* @nolint
|
||||
* @preventMunge
|
||||
* @generated SignedSource<<10050bb86cef9b7c923695c42bf0b742>>
|
||||
* @generated SignedSource<<dc37784bcc9820f04c214de7627f4f6c>>
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -30117,11 +30117,11 @@ __DEV__ &&
|
||||
};
|
||||
(function () {
|
||||
var isomorphicReactPackageVersion = React.version;
|
||||
if ("19.3.0-native-fb-ed1351c4-20251016" !== isomorphicReactPackageVersion)
|
||||
if ("19.3.0-native-fb-2381ecc2-20251016" !== 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.3.0-native-fb-ed1351c4-20251016\nLearn more: https://react.dev/warnings/version-mismatch")
|
||||
"\n - react-dom: 19.3.0-native-fb-2381ecc2-20251016\nLearn more: https://react.dev/warnings/version-mismatch")
|
||||
);
|
||||
})();
|
||||
("function" === typeof Map &&
|
||||
@@ -30158,10 +30158,10 @@ __DEV__ &&
|
||||
!(function () {
|
||||
var internals = {
|
||||
bundleType: 1,
|
||||
version: "19.3.0-native-fb-ed1351c4-20251016",
|
||||
version: "19.3.0-native-fb-2381ecc2-20251016",
|
||||
rendererPackageName: "react-dom",
|
||||
currentDispatcherRef: ReactSharedInternals,
|
||||
reconcilerVersion: "19.3.0-native-fb-ed1351c4-20251016"
|
||||
reconcilerVersion: "19.3.0-native-fb-2381ecc2-20251016"
|
||||
};
|
||||
internals.overrideHookState = overrideHookState;
|
||||
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
|
||||
@@ -30311,5 +30311,5 @@ __DEV__ &&
|
||||
listenToAllSupportedEvents(container);
|
||||
return new ReactDOMHydrationRoot(initialChildren);
|
||||
};
|
||||
exports.version = "19.3.0-native-fb-ed1351c4-20251016";
|
||||
exports.version = "19.3.0-native-fb-2381ecc2-20251016";
|
||||
})();
|
||||
|
||||
compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOMClient-prod.js
Vendored
+6
-6
@@ -7,7 +7,7 @@
|
||||
* @noflow
|
||||
* @nolint
|
||||
* @preventMunge
|
||||
* @generated SignedSource<<363e7039da3eaf3fe0bea474ac2a0bf8>>
|
||||
* @generated SignedSource<<519110be3010af2965ebbe1441b70c7f>>
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -17581,14 +17581,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) {
|
||||
};
|
||||
var isomorphicReactPackageVersion$jscomp$inline_2060 = React.version;
|
||||
if (
|
||||
"19.3.0-native-fb-ed1351c4-20251016" !==
|
||||
"19.3.0-native-fb-2381ecc2-20251016" !==
|
||||
isomorphicReactPackageVersion$jscomp$inline_2060
|
||||
)
|
||||
throw Error(
|
||||
formatProdErrorMessage(
|
||||
527,
|
||||
isomorphicReactPackageVersion$jscomp$inline_2060,
|
||||
"19.3.0-native-fb-ed1351c4-20251016"
|
||||
"19.3.0-native-fb-2381ecc2-20251016"
|
||||
)
|
||||
);
|
||||
ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
|
||||
@@ -17610,10 +17610,10 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
|
||||
};
|
||||
var internals$jscomp$inline_2637 = {
|
||||
bundleType: 0,
|
||||
version: "19.3.0-native-fb-ed1351c4-20251016",
|
||||
version: "19.3.0-native-fb-2381ecc2-20251016",
|
||||
rendererPackageName: "react-dom",
|
||||
currentDispatcherRef: ReactSharedInternals,
|
||||
reconcilerVersion: "19.3.0-native-fb-ed1351c4-20251016"
|
||||
reconcilerVersion: "19.3.0-native-fb-2381ecc2-20251016"
|
||||
};
|
||||
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
|
||||
var hook$jscomp$inline_2638 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
|
||||
@@ -17720,4 +17720,4 @@ exports.hydrateRoot = function (container, initialChildren, options) {
|
||||
listenToAllSupportedEvents(container);
|
||||
return new ReactDOMHydrationRoot(initialChildren);
|
||||
};
|
||||
exports.version = "19.3.0-native-fb-ed1351c4-20251016";
|
||||
exports.version = "19.3.0-native-fb-2381ecc2-20251016";
|
||||
|
||||
+6
-6
@@ -7,7 +7,7 @@
|
||||
* @noflow
|
||||
* @nolint
|
||||
* @preventMunge
|
||||
* @generated SignedSource<<839a1ddc7e6dd708b23f2243d86967ce>>
|
||||
* @generated SignedSource<<09e0d1994fbc8f238fb7e61c35e100f5>>
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -19703,14 +19703,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) {
|
||||
};
|
||||
var isomorphicReactPackageVersion$jscomp$inline_2375 = React.version;
|
||||
if (
|
||||
"19.3.0-native-fb-ed1351c4-20251016" !==
|
||||
"19.3.0-native-fb-2381ecc2-20251016" !==
|
||||
isomorphicReactPackageVersion$jscomp$inline_2375
|
||||
)
|
||||
throw Error(
|
||||
formatProdErrorMessage(
|
||||
527,
|
||||
isomorphicReactPackageVersion$jscomp$inline_2375,
|
||||
"19.3.0-native-fb-ed1351c4-20251016"
|
||||
"19.3.0-native-fb-2381ecc2-20251016"
|
||||
)
|
||||
);
|
||||
ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
|
||||
@@ -19732,10 +19732,10 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
|
||||
};
|
||||
var internals$jscomp$inline_2382 = {
|
||||
bundleType: 0,
|
||||
version: "19.3.0-native-fb-ed1351c4-20251016",
|
||||
version: "19.3.0-native-fb-2381ecc2-20251016",
|
||||
rendererPackageName: "react-dom",
|
||||
currentDispatcherRef: ReactSharedInternals,
|
||||
reconcilerVersion: "19.3.0-native-fb-ed1351c4-20251016",
|
||||
reconcilerVersion: "19.3.0-native-fb-2381ecc2-20251016",
|
||||
getLaneLabelMap: function () {
|
||||
for (
|
||||
var map = new Map(), lane = 1, index$332 = 0;
|
||||
@@ -19858,4 +19858,4 @@ exports.hydrateRoot = function (container, initialChildren, options) {
|
||||
listenToAllSupportedEvents(container);
|
||||
return new ReactDOMHydrationRoot(initialChildren);
|
||||
};
|
||||
exports.version = "19.3.0-native-fb-ed1351c4-20251016";
|
||||
exports.version = "19.3.0-native-fb-2381ecc2-20251016";
|
||||
|
||||
+6
-6
@@ -7,7 +7,7 @@
|
||||
* @noflow
|
||||
* @nolint
|
||||
* @preventMunge
|
||||
* @generated SignedSource<<0fe412611812eec10d6b28d328f42188>>
|
||||
* @generated SignedSource<<23a9d5665bf5c0379547e040a4b38f94>>
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -30173,11 +30173,11 @@ __DEV__ &&
|
||||
};
|
||||
(function () {
|
||||
var isomorphicReactPackageVersion = React.version;
|
||||
if ("19.3.0-native-fb-ed1351c4-20251016" !== isomorphicReactPackageVersion)
|
||||
if ("19.3.0-native-fb-2381ecc2-20251016" !== 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.3.0-native-fb-ed1351c4-20251016\nLearn more: https://react.dev/warnings/version-mismatch")
|
||||
"\n - react-dom: 19.3.0-native-fb-2381ecc2-20251016\nLearn more: https://react.dev/warnings/version-mismatch")
|
||||
);
|
||||
})();
|
||||
("function" === typeof Map &&
|
||||
@@ -30214,10 +30214,10 @@ __DEV__ &&
|
||||
!(function () {
|
||||
var internals = {
|
||||
bundleType: 1,
|
||||
version: "19.3.0-native-fb-ed1351c4-20251016",
|
||||
version: "19.3.0-native-fb-2381ecc2-20251016",
|
||||
rendererPackageName: "react-dom",
|
||||
currentDispatcherRef: ReactSharedInternals,
|
||||
reconcilerVersion: "19.3.0-native-fb-ed1351c4-20251016"
|
||||
reconcilerVersion: "19.3.0-native-fb-2381ecc2-20251016"
|
||||
};
|
||||
internals.overrideHookState = overrideHookState;
|
||||
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
|
||||
@@ -30683,7 +30683,7 @@ __DEV__ &&
|
||||
exports.useFormStatus = function () {
|
||||
return resolveDispatcher().useHostTransitionStatus();
|
||||
};
|
||||
exports.version = "19.3.0-native-fb-ed1351c4-20251016";
|
||||
exports.version = "19.3.0-native-fb-2381ecc2-20251016";
|
||||
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
|
||||
"function" ===
|
||||
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
|
||||
|
||||
+6
-6
@@ -7,7 +7,7 @@
|
||||
* @noflow
|
||||
* @nolint
|
||||
* @preventMunge
|
||||
* @generated SignedSource<<4ac36dbf5ef6b77c072bd3c9130ef85c>>
|
||||
* @generated SignedSource<<66ff435cdc7b6739b13c5d68c3114ccd>>
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -17592,14 +17592,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) {
|
||||
};
|
||||
var isomorphicReactPackageVersion$jscomp$inline_2061 = React.version;
|
||||
if (
|
||||
"19.3.0-native-fb-ed1351c4-20251016" !==
|
||||
"19.3.0-native-fb-2381ecc2-20251016" !==
|
||||
isomorphicReactPackageVersion$jscomp$inline_2061
|
||||
)
|
||||
throw Error(
|
||||
formatProdErrorMessage(
|
||||
527,
|
||||
isomorphicReactPackageVersion$jscomp$inline_2061,
|
||||
"19.3.0-native-fb-ed1351c4-20251016"
|
||||
"19.3.0-native-fb-2381ecc2-20251016"
|
||||
)
|
||||
);
|
||||
ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
|
||||
@@ -17621,10 +17621,10 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
|
||||
};
|
||||
var internals$jscomp$inline_2640 = {
|
||||
bundleType: 0,
|
||||
version: "19.3.0-native-fb-ed1351c4-20251016",
|
||||
version: "19.3.0-native-fb-2381ecc2-20251016",
|
||||
rendererPackageName: "react-dom",
|
||||
currentDispatcherRef: ReactSharedInternals,
|
||||
reconcilerVersion: "19.3.0-native-fb-ed1351c4-20251016"
|
||||
reconcilerVersion: "19.3.0-native-fb-2381ecc2-20251016"
|
||||
};
|
||||
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
|
||||
var hook$jscomp$inline_2641 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
|
||||
@@ -17884,4 +17884,4 @@ exports.useFormState = function (action, initialState, permalink) {
|
||||
exports.useFormStatus = function () {
|
||||
return ReactSharedInternals.H.useHostTransitionStatus();
|
||||
};
|
||||
exports.version = "19.3.0-native-fb-ed1351c4-20251016";
|
||||
exports.version = "19.3.0-native-fb-2381ecc2-20251016";
|
||||
|
||||
+6
-6
@@ -7,7 +7,7 @@
|
||||
* @noflow
|
||||
* @nolint
|
||||
* @preventMunge
|
||||
* @generated SignedSource<<f5badcefde854907a6bfa274ee94bd3f>>
|
||||
* @generated SignedSource<<e2f3541479d8e55a7c10f52e2d23bf37>>
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -19718,14 +19718,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) {
|
||||
};
|
||||
var isomorphicReactPackageVersion$jscomp$inline_2376 = React.version;
|
||||
if (
|
||||
"19.3.0-native-fb-ed1351c4-20251016" !==
|
||||
"19.3.0-native-fb-2381ecc2-20251016" !==
|
||||
isomorphicReactPackageVersion$jscomp$inline_2376
|
||||
)
|
||||
throw Error(
|
||||
formatProdErrorMessage(
|
||||
527,
|
||||
isomorphicReactPackageVersion$jscomp$inline_2376,
|
||||
"19.3.0-native-fb-ed1351c4-20251016"
|
||||
"19.3.0-native-fb-2381ecc2-20251016"
|
||||
)
|
||||
);
|
||||
ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
|
||||
@@ -19747,10 +19747,10 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
|
||||
};
|
||||
var internals$jscomp$inline_2383 = {
|
||||
bundleType: 0,
|
||||
version: "19.3.0-native-fb-ed1351c4-20251016",
|
||||
version: "19.3.0-native-fb-2381ecc2-20251016",
|
||||
rendererPackageName: "react-dom",
|
||||
currentDispatcherRef: ReactSharedInternals,
|
||||
reconcilerVersion: "19.3.0-native-fb-ed1351c4-20251016",
|
||||
reconcilerVersion: "19.3.0-native-fb-2381ecc2-20251016",
|
||||
getLaneLabelMap: function () {
|
||||
for (
|
||||
var map = new Map(), lane = 1, index$332 = 0;
|
||||
@@ -20026,7 +20026,7 @@ exports.useFormState = function (action, initialState, permalink) {
|
||||
exports.useFormStatus = function () {
|
||||
return ReactSharedInternals.H.useHostTransitionStatus();
|
||||
};
|
||||
exports.version = "19.3.0-native-fb-ed1351c4-20251016";
|
||||
exports.version = "19.3.0-native-fb-2381ecc2-20251016";
|
||||
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
|
||||
"function" ===
|
||||
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
|
||||
|
||||
+4
-4
@@ -7,7 +7,7 @@
|
||||
* @noflow
|
||||
* @nolint
|
||||
* @preventMunge
|
||||
* @generated SignedSource<<907b973b3903e6e95b9fd809ce679019>>
|
||||
* @generated SignedSource<<cd3a28a3c8fe3d6c0df1fdcf82a3b85a>>
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
@@ -16021,10 +16021,10 @@ __DEV__ &&
|
||||
(function () {
|
||||
var internals = {
|
||||
bundleType: 1,
|
||||
version: "19.3.0-native-fb-ed1351c4-20251016",
|
||||
version: "19.3.0-native-fb-2381ecc2-20251016",
|
||||
rendererPackageName: "react-test-renderer",
|
||||
currentDispatcherRef: ReactSharedInternals,
|
||||
reconcilerVersion: "19.3.0-native-fb-ed1351c4-20251016"
|
||||
reconcilerVersion: "19.3.0-native-fb-2381ecc2-20251016"
|
||||
};
|
||||
internals.overrideHookState = overrideHookState;
|
||||
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
|
||||
@@ -16170,5 +16170,5 @@ __DEV__ &&
|
||||
flushSyncWorkAcrossRoots_impl(0, !0));
|
||||
}
|
||||
};
|
||||
exports.version = "19.3.0-native-fb-ed1351c4-20251016";
|
||||
exports.version = "19.3.0-native-fb-2381ecc2-20251016";
|
||||
})();
|
||||
|
||||
+4
-4
@@ -7,7 +7,7 @@
|
||||
* @noflow
|
||||
* @nolint
|
||||
* @preventMunge
|
||||
* @generated SignedSource<<cf42a877ffac93e38b43a081b65d097f>>
|
||||
* @generated SignedSource<<b72deed66ba3daa2c81ba8c8b26bfb0f>>
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
@@ -10110,10 +10110,10 @@ function wrapFiber(fiber) {
|
||||
}
|
||||
var internals$jscomp$inline_1494 = {
|
||||
bundleType: 0,
|
||||
version: "19.3.0-native-fb-ed1351c4-20251016",
|
||||
version: "19.3.0-native-fb-2381ecc2-20251016",
|
||||
rendererPackageName: "react-test-renderer",
|
||||
currentDispatcherRef: ReactSharedInternals,
|
||||
reconcilerVersion: "19.3.0-native-fb-ed1351c4-20251016"
|
||||
reconcilerVersion: "19.3.0-native-fb-2381ecc2-20251016"
|
||||
};
|
||||
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
|
||||
var hook$jscomp$inline_1495 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
|
||||
@@ -10249,4 +10249,4 @@ exports.unstable_batchedUpdates = function (fn, a) {
|
||||
flushSyncWorkAcrossRoots_impl(0, !0));
|
||||
}
|
||||
};
|
||||
exports.version = "19.3.0-native-fb-ed1351c4-20251016";
|
||||
exports.version = "19.3.0-native-fb-2381ecc2-20251016";
|
||||
|
||||
+4
-4
@@ -7,7 +7,7 @@
|
||||
* @noflow
|
||||
* @nolint
|
||||
* @preventMunge
|
||||
* @generated SignedSource<<0d381b50ed74e5d304500b9608f4b564>>
|
||||
* @generated SignedSource<<6d7b38b8802b689ec032b47b6a11450c>>
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
@@ -10731,10 +10731,10 @@ function wrapFiber(fiber) {
|
||||
}
|
||||
var internals$jscomp$inline_1275 = {
|
||||
bundleType: 0,
|
||||
version: "19.3.0-native-fb-ed1351c4-20251016",
|
||||
version: "19.3.0-native-fb-2381ecc2-20251016",
|
||||
rendererPackageName: "react-test-renderer",
|
||||
currentDispatcherRef: ReactSharedInternals,
|
||||
reconcilerVersion: "19.3.0-native-fb-ed1351c4-20251016",
|
||||
reconcilerVersion: "19.3.0-native-fb-2381ecc2-20251016",
|
||||
getLaneLabelMap: function () {
|
||||
for (
|
||||
var map = new Map(), lane = 1, index$147 = 0;
|
||||
@@ -10885,4 +10885,4 @@ exports.unstable_batchedUpdates = function (fn, a) {
|
||||
flushSyncWorkAcrossRoots_impl(0, !0));
|
||||
}
|
||||
};
|
||||
exports.version = "19.3.0-native-fb-ed1351c4-20251016";
|
||||
exports.version = "19.3.0-native-fb-2381ecc2-20251016";
|
||||
|
||||
+2
-2
@@ -7,7 +7,7 @@
|
||||
* @noflow
|
||||
* @nolint
|
||||
* @preventMunge
|
||||
* @generated SignedSource<<3a58af1cc597b0599dd0d45f8c6ff844>>
|
||||
* @generated SignedSource<<23933cbfda2b1357b78f1d04c06e6b6f>>
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
@@ -1421,7 +1421,7 @@ __DEV__ &&
|
||||
exports.useTransition = function () {
|
||||
return resolveDispatcher().useTransition();
|
||||
};
|
||||
exports.version = "19.3.0-native-fb-ed1351c4-20251016";
|
||||
exports.version = "19.3.0-native-fb-2381ecc2-20251016";
|
||||
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
|
||||
"function" ===
|
||||
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
|
||||
|
||||
+2
-2
@@ -7,7 +7,7 @@
|
||||
* @noflow
|
||||
* @nolint
|
||||
* @preventMunge
|
||||
* @generated SignedSource<<7dcd3dbf90f859f2ebb5fcac67236be7>>
|
||||
* @generated SignedSource<<1c4b009da07f7e1edb7030664a6da637>>
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
@@ -586,4 +586,4 @@ exports.useSyncExternalStore = function (
|
||||
exports.useTransition = function () {
|
||||
return ReactSharedInternals.H.useTransition();
|
||||
};
|
||||
exports.version = "19.3.0-native-fb-ed1351c4-20251016";
|
||||
exports.version = "19.3.0-native-fb-2381ecc2-20251016";
|
||||
|
||||
Vendored
+2
-2
@@ -7,7 +7,7 @@
|
||||
* @noflow
|
||||
* @nolint
|
||||
* @preventMunge
|
||||
* @generated SignedSource<<990d8e292947c8e70a9d50fbc3774e92>>
|
||||
* @generated SignedSource<<c913c6ce852ac36428243c5892b9263a>>
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
@@ -590,7 +590,7 @@ exports.useSyncExternalStore = function (
|
||||
exports.useTransition = function () {
|
||||
return ReactSharedInternals.H.useTransition();
|
||||
};
|
||||
exports.version = "19.3.0-native-fb-ed1351c4-20251016";
|
||||
exports.version = "19.3.0-native-fb-2381ecc2-20251016";
|
||||
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
|
||||
"function" ===
|
||||
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
ed1351c4fb92f84657a0c1a2af5ccef2484f7bd7
|
||||
2381ecc290c588f6366bdcf377529668bb3cc360
|
||||
|
||||
+3
-3
@@ -7,7 +7,7 @@
|
||||
* @noflow
|
||||
* @nolint
|
||||
* @preventMunge
|
||||
* @generated SignedSource<<79889028a83a8a256b2dce24da91645f>>
|
||||
* @generated SignedSource<<2690160d3109526f4f577fbf365c6125>>
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
@@ -20085,10 +20085,10 @@ __DEV__ &&
|
||||
(function () {
|
||||
var internals = {
|
||||
bundleType: 1,
|
||||
version: "19.3.0-native-fb-ed1351c4-20251016",
|
||||
version: "19.3.0-native-fb-2381ecc2-20251016",
|
||||
rendererPackageName: "react-native-renderer",
|
||||
currentDispatcherRef: ReactSharedInternals,
|
||||
reconcilerVersion: "19.3.0-native-fb-ed1351c4-20251016"
|
||||
reconcilerVersion: "19.3.0-native-fb-2381ecc2-20251016"
|
||||
};
|
||||
null !== extraDevToolsConfig &&
|
||||
(internals.rendererConfig = extraDevToolsConfig);
|
||||
|
||||
+3
-3
@@ -7,7 +7,7 @@
|
||||
* @noflow
|
||||
* @nolint
|
||||
* @preventMunge
|
||||
* @generated SignedSource<<80ed641b64fe76b066215bf256151552>>
|
||||
* @generated SignedSource<<da22658002aa3a32e67efe60f4faf419>>
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
@@ -11269,10 +11269,10 @@ batchedUpdatesImpl = function (fn, a) {
|
||||
var roots = new Map(),
|
||||
internals$jscomp$inline_1321 = {
|
||||
bundleType: 0,
|
||||
version: "19.3.0-native-fb-ed1351c4-20251016",
|
||||
version: "19.3.0-native-fb-2381ecc2-20251016",
|
||||
rendererPackageName: "react-native-renderer",
|
||||
currentDispatcherRef: ReactSharedInternals,
|
||||
reconcilerVersion: "19.3.0-native-fb-ed1351c4-20251016"
|
||||
reconcilerVersion: "19.3.0-native-fb-2381ecc2-20251016"
|
||||
};
|
||||
null !== extraDevToolsConfig &&
|
||||
(internals$jscomp$inline_1321.rendererConfig = extraDevToolsConfig);
|
||||
|
||||
+3
-3
@@ -7,7 +7,7 @@
|
||||
* @noflow
|
||||
* @nolint
|
||||
* @preventMunge
|
||||
* @generated SignedSource<<58162d8c4274d4ce99d837329a2c8d47>>
|
||||
* @generated SignedSource<<296bbe4ea6b45c9da56efce644f0194d>>
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
@@ -13334,10 +13334,10 @@ batchedUpdatesImpl = function (fn, a) {
|
||||
var roots = new Map(),
|
||||
internals$jscomp$inline_1629 = {
|
||||
bundleType: 0,
|
||||
version: "19.3.0-native-fb-ed1351c4-20251016",
|
||||
version: "19.3.0-native-fb-2381ecc2-20251016",
|
||||
rendererPackageName: "react-native-renderer",
|
||||
currentDispatcherRef: ReactSharedInternals,
|
||||
reconcilerVersion: "19.3.0-native-fb-ed1351c4-20251016"
|
||||
reconcilerVersion: "19.3.0-native-fb-2381ecc2-20251016"
|
||||
};
|
||||
null !== extraDevToolsConfig &&
|
||||
(internals$jscomp$inline_1629.rendererConfig = extraDevToolsConfig);
|
||||
|
||||
+5
-5
@@ -7,7 +7,7 @@
|
||||
* @noflow
|
||||
* @nolint
|
||||
* @preventMunge
|
||||
* @generated SignedSource<<9adec0f3f0b32ead79ded68daba48372>>
|
||||
* @generated SignedSource<<f723fddcb54b19e58aeede02c31cf24a>>
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
@@ -20354,11 +20354,11 @@ __DEV__ &&
|
||||
shouldSuspendImpl = newShouldSuspendImpl;
|
||||
};
|
||||
var isomorphicReactPackageVersion = React.version;
|
||||
if ("19.3.0-native-fb-ed1351c4-20251016" !== isomorphicReactPackageVersion)
|
||||
if ("19.3.0-native-fb-2381ecc2-20251016" !== 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.3.0-native-fb-ed1351c4-20251016\nLearn more: https://react.dev/warnings/version-mismatch")
|
||||
"\n - react-native-renderer: 19.3.0-native-fb-2381ecc2-20251016\nLearn more: https://react.dev/warnings/version-mismatch")
|
||||
);
|
||||
if (
|
||||
"function" !==
|
||||
@@ -20384,10 +20384,10 @@ __DEV__ &&
|
||||
(function () {
|
||||
var internals = {
|
||||
bundleType: 1,
|
||||
version: "19.3.0-native-fb-ed1351c4-20251016",
|
||||
version: "19.3.0-native-fb-2381ecc2-20251016",
|
||||
rendererPackageName: "react-native-renderer",
|
||||
currentDispatcherRef: ReactSharedInternals,
|
||||
reconcilerVersion: "19.3.0-native-fb-ed1351c4-20251016"
|
||||
reconcilerVersion: "19.3.0-native-fb-2381ecc2-20251016"
|
||||
};
|
||||
null !== extraDevToolsConfig &&
|
||||
(internals.rendererConfig = extraDevToolsConfig);
|
||||
|
||||
+5
-5
@@ -7,7 +7,7 @@
|
||||
* @noflow
|
||||
* @nolint
|
||||
* @preventMunge
|
||||
* @generated SignedSource<<b5336503c4fdbe6dd3aa6d6a58ae6741>>
|
||||
* @generated SignedSource<<13b801bebe3073742aab84745cd367fa>>
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
@@ -11430,11 +11430,11 @@ function updateContainer(element, container, parentComponent, callback) {
|
||||
return lane;
|
||||
}
|
||||
var isomorphicReactPackageVersion = React.version;
|
||||
if ("19.3.0-native-fb-ed1351c4-20251016" !== isomorphicReactPackageVersion)
|
||||
if ("19.3.0-native-fb-2381ecc2-20251016" !== 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.3.0-native-fb-ed1351c4-20251016\nLearn more: https://react.dev/warnings/version-mismatch")
|
||||
"\n - react-native-renderer: 19.3.0-native-fb-2381ecc2-20251016\nLearn more: https://react.dev/warnings/version-mismatch")
|
||||
);
|
||||
if (
|
||||
"function" !==
|
||||
@@ -11484,10 +11484,10 @@ batchedUpdatesImpl = function (fn, a) {
|
||||
var roots = new Map(),
|
||||
internals$jscomp$inline_1327 = {
|
||||
bundleType: 0,
|
||||
version: "19.3.0-native-fb-ed1351c4-20251016",
|
||||
version: "19.3.0-native-fb-2381ecc2-20251016",
|
||||
rendererPackageName: "react-native-renderer",
|
||||
currentDispatcherRef: ReactSharedInternals,
|
||||
reconcilerVersion: "19.3.0-native-fb-ed1351c4-20251016"
|
||||
reconcilerVersion: "19.3.0-native-fb-2381ecc2-20251016"
|
||||
};
|
||||
null !== extraDevToolsConfig &&
|
||||
(internals$jscomp$inline_1327.rendererConfig = extraDevToolsConfig);
|
||||
|
||||
+5
-5
@@ -7,7 +7,7 @@
|
||||
* @noflow
|
||||
* @nolint
|
||||
* @preventMunge
|
||||
* @generated SignedSource<<aa824507a30db71c6172d354e99269b9>>
|
||||
* @generated SignedSource<<e62a2d4feaabb12059c2704b7f4beae1>>
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
@@ -13488,11 +13488,11 @@ function updateContainer(element, container, parentComponent, callback) {
|
||||
return lane;
|
||||
}
|
||||
var isomorphicReactPackageVersion = React.version;
|
||||
if ("19.3.0-native-fb-ed1351c4-20251016" !== isomorphicReactPackageVersion)
|
||||
if ("19.3.0-native-fb-2381ecc2-20251016" !== 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.3.0-native-fb-ed1351c4-20251016\nLearn more: https://react.dev/warnings/version-mismatch")
|
||||
"\n - react-native-renderer: 19.3.0-native-fb-2381ecc2-20251016\nLearn more: https://react.dev/warnings/version-mismatch")
|
||||
);
|
||||
if (
|
||||
"function" !==
|
||||
@@ -13542,10 +13542,10 @@ batchedUpdatesImpl = function (fn, a) {
|
||||
var roots = new Map(),
|
||||
internals$jscomp$inline_1635 = {
|
||||
bundleType: 0,
|
||||
version: "19.3.0-native-fb-ed1351c4-20251016",
|
||||
version: "19.3.0-native-fb-2381ecc2-20251016",
|
||||
rendererPackageName: "react-native-renderer",
|
||||
currentDispatcherRef: ReactSharedInternals,
|
||||
reconcilerVersion: "19.3.0-native-fb-ed1351c4-20251016"
|
||||
reconcilerVersion: "19.3.0-native-fb-2381ecc2-20251016"
|
||||
};
|
||||
null !== extraDevToolsConfig &&
|
||||
(internals$jscomp$inline_1635.rendererConfig = extraDevToolsConfig);
|
||||
|
||||
+15
-1
@@ -12,7 +12,7 @@
|
||||
* @lightSyntaxTransform
|
||||
* @preventMunge
|
||||
* @oncall react_core
|
||||
* @generated SignedSource<<6657e19da8a50d83dcf48cd0b8c03467>>
|
||||
* @generated SignedSource<<fb7c46c921587440ce9be1afbf72f4f6>>
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
@@ -57395,6 +57395,10 @@ function isUseEffectEventIdentifier(node) {
|
||||
return node.type === 'Identifier' && node.name === 'useEffectEvent';
|
||||
}
|
||||
function useEffectEventError(fn, called) {
|
||||
if (fn === null) {
|
||||
return (`React Hook "useEffectEvent" can only be called at the top level of your component.` +
|
||||
` It cannot be passed down.`);
|
||||
}
|
||||
return (`\`${fn}\` is a function created with React Hook "useEffectEvent", and can only be called from ` +
|
||||
'Effects and Effect Events in the same component.' +
|
||||
(called ? '' : ' It cannot be assigned to a variable or passed down.'));
|
||||
@@ -57694,6 +57698,7 @@ const rule = {
|
||||
analyzer.leaveNode(node);
|
||||
},
|
||||
CallExpression(node) {
|
||||
var _a, _b;
|
||||
if (isHook(node.callee)) {
|
||||
const reactHooksMap = last(codePathReactHooksMapStack);
|
||||
const codePathSegment = last(codePathSegmentStack);
|
||||
@@ -57710,6 +57715,15 @@ const rule = {
|
||||
node.arguments.length > 0) {
|
||||
lastEffect = node;
|
||||
}
|
||||
if (isUseEffectEventIdentifier(nodeWithoutNamespace) &&
|
||||
((_a = node.parent) === null || _a === void 0 ? void 0 : _a.type) !== 'VariableDeclarator' &&
|
||||
((_b = node.parent) === null || _b === void 0 ? void 0 : _b.type) !== 'ExpressionStatement') {
|
||||
const message = useEffectEventError(null, false);
|
||||
context.report({
|
||||
node,
|
||||
message,
|
||||
});
|
||||
}
|
||||
},
|
||||
Identifier(node) {
|
||||
if (lastEffect == null && useEffectEventFunctions.has(node)) {
|
||||
|
||||
+15
-1
@@ -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<<7b33439ead54919661a5d316b265430a>>
|
||||
* @generated SignedSource<<9079307abbe1c09d1a87c55c574480ba>>
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
@@ -57174,6 +57174,10 @@ function isUseEffectEventIdentifier(node) {
|
||||
return node.type === 'Identifier' && node.name === 'useEffectEvent';
|
||||
}
|
||||
function useEffectEventError(fn, called) {
|
||||
if (fn === null) {
|
||||
return (`React Hook "useEffectEvent" can only be called at the top level of your component.` +
|
||||
` It cannot be passed down.`);
|
||||
}
|
||||
return (`\`${fn}\` is a function created with React Hook "useEffectEvent", and can only be called from ` +
|
||||
'Effects and Effect Events in the same component.' +
|
||||
(called ? '' : ' It cannot be assigned to a variable or passed down.'));
|
||||
@@ -57473,6 +57477,7 @@ const rule = {
|
||||
analyzer.leaveNode(node);
|
||||
},
|
||||
CallExpression(node) {
|
||||
var _a, _b;
|
||||
if (isHook(node.callee)) {
|
||||
const reactHooksMap = last(codePathReactHooksMapStack);
|
||||
const codePathSegment = last(codePathSegmentStack);
|
||||
@@ -57489,6 +57494,15 @@ const rule = {
|
||||
node.arguments.length > 0) {
|
||||
lastEffect = node;
|
||||
}
|
||||
if (isUseEffectEventIdentifier(nodeWithoutNamespace) &&
|
||||
((_a = node.parent) === null || _a === void 0 ? void 0 : _a.type) !== 'VariableDeclarator' &&
|
||||
((_b = node.parent) === null || _b === void 0 ? void 0 : _b.type) !== 'ExpressionStatement') {
|
||||
const message = useEffectEventError(null, false);
|
||||
context.report({
|
||||
node,
|
||||
message,
|
||||
});
|
||||
}
|
||||
},
|
||||
Identifier(node) {
|
||||
if (lastEffect == null && useEffectEventFunctions.has(node)) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "eslint-plugin-react-hooks",
|
||||
"description": "ESLint rules for React Hooks",
|
||||
"version": "0.0.0-experimental-ed1351c4-20251016",
|
||||
"version": "0.0.0-experimental-2381ecc2-20251016",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/facebook/react.git",
|
||||
|
||||
Reference in New Issue
Block a user