mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Fix Flow types of useEffectEvent (#26468)
## Summary
Just copied the types over from the internal types. Type error was
hidden by overly broad FlowFixMe. With `$FlowFixMe[not-a-function]` we
would've seen the actual issue:
```
Cannot return `dispatcher.useEffectEvent(...)` because `T` [1] is incompatible with undefined [2].Flow(incompatible-return)
```
## How did you test this change?
- [x] yarn flow dom-node
- [x] CI
DiffTrain build for [d12bdcda69](https://github.com/facebook/react/commit/d12bdcda69afd219f4d91cbd60d6fae2a375d35b)
This commit is contained in:
@@ -1 +1 @@
|
||||
73b6435ca4e0c3ae3aac8126509a82420a84f0d7
|
||||
d12bdcda69afd219f4d91cbd60d6fae2a375d35b
|
||||
|
||||
@@ -27,7 +27,7 @@ if (
|
||||
}
|
||||
"use strict";
|
||||
|
||||
var ReactVersion = "18.3.0-www-classic-e762d1a9";
|
||||
var ReactVersion = "18.3.0-www-classic-1745b9a1";
|
||||
|
||||
// ATTENTION
|
||||
// When adding new symbols to this file,
|
||||
@@ -2011,22 +2011,22 @@ function useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {
|
||||
);
|
||||
}
|
||||
function useCacheRefresh() {
|
||||
var dispatcher = resolveDispatcher(); // $FlowFixMe This is unstable, thus optional
|
||||
var dispatcher = resolveDispatcher(); // $FlowFixMe[not-a-function] This is unstable, thus optional
|
||||
|
||||
return dispatcher.useCacheRefresh();
|
||||
}
|
||||
function use(usable) {
|
||||
var dispatcher = resolveDispatcher(); // $FlowFixMe This is unstable, thus optional
|
||||
var dispatcher = resolveDispatcher(); // $FlowFixMe[not-a-function] This is unstable, thus optional
|
||||
|
||||
return dispatcher.use(usable);
|
||||
}
|
||||
function useMemoCache(size) {
|
||||
var dispatcher = resolveDispatcher(); // $FlowFixMe This is unstable, thus optional
|
||||
var dispatcher = resolveDispatcher(); // $FlowFixMe[not-a-function] This is unstable, thus optional
|
||||
|
||||
return dispatcher.useMemoCache(size);
|
||||
}
|
||||
function useEffectEvent(callback) {
|
||||
var dispatcher = resolveDispatcher(); // $FlowFixMe This is unstable, thus optional
|
||||
var dispatcher = resolveDispatcher(); // $FlowFixMe[not-a-function] This is unstable, thus optional
|
||||
|
||||
return dispatcher.useEffectEvent(callback);
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ if (
|
||||
}
|
||||
"use strict";
|
||||
|
||||
var ReactVersion = "18.3.0-www-modern-11df97fe";
|
||||
var ReactVersion = "18.3.0-www-modern-770d70a2";
|
||||
|
||||
// ATTENTION
|
||||
// When adding new symbols to this file,
|
||||
@@ -2011,22 +2011,22 @@ function useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {
|
||||
);
|
||||
}
|
||||
function useCacheRefresh() {
|
||||
var dispatcher = resolveDispatcher(); // $FlowFixMe This is unstable, thus optional
|
||||
var dispatcher = resolveDispatcher(); // $FlowFixMe[not-a-function] This is unstable, thus optional
|
||||
|
||||
return dispatcher.useCacheRefresh();
|
||||
}
|
||||
function use(usable) {
|
||||
var dispatcher = resolveDispatcher(); // $FlowFixMe This is unstable, thus optional
|
||||
var dispatcher = resolveDispatcher(); // $FlowFixMe[not-a-function] This is unstable, thus optional
|
||||
|
||||
return dispatcher.use(usable);
|
||||
}
|
||||
function useMemoCache(size) {
|
||||
var dispatcher = resolveDispatcher(); // $FlowFixMe This is unstable, thus optional
|
||||
var dispatcher = resolveDispatcher(); // $FlowFixMe[not-a-function] This is unstable, thus optional
|
||||
|
||||
return dispatcher.useMemoCache(size);
|
||||
}
|
||||
function useEffectEvent(callback) {
|
||||
var dispatcher = resolveDispatcher(); // $FlowFixMe This is unstable, thus optional
|
||||
var dispatcher = resolveDispatcher(); // $FlowFixMe[not-a-function] This is unstable, thus optional
|
||||
|
||||
return dispatcher.useEffectEvent(callback);
|
||||
}
|
||||
|
||||
@@ -15987,7 +15987,7 @@ Internals.Events = [
|
||||
var devToolsConfig$jscomp$inline_1754 = {
|
||||
findFiberByHostInstance: getClosestInstanceFromNode,
|
||||
bundleType: 0,
|
||||
version: "18.3.0-www-modern-11df97fe",
|
||||
version: "18.3.0-www-modern-770d70a2",
|
||||
rendererPackageName: "react-dom"
|
||||
};
|
||||
var internals$jscomp$inline_2154 = {
|
||||
@@ -16018,7 +16018,7 @@ var internals$jscomp$inline_2154 = {
|
||||
scheduleRoot: null,
|
||||
setRefreshHandler: null,
|
||||
getCurrentFiber: null,
|
||||
reconcilerVersion: "18.3.0-www-modern-11df97fe"
|
||||
reconcilerVersion: "18.3.0-www-modern-770d70a2"
|
||||
};
|
||||
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
|
||||
var hook$jscomp$inline_2155 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
|
||||
@@ -16338,4 +16338,4 @@ exports.unstable_createEventHandle = function (type, options) {
|
||||
return eventHandle;
|
||||
};
|
||||
exports.unstable_runWithPriority = runWithPriority;
|
||||
exports.version = "18.3.0-www-modern-11df97fe";
|
||||
exports.version = "18.3.0-www-modern-770d70a2";
|
||||
|
||||
@@ -24353,7 +24353,7 @@ function createFiberRoot(
|
||||
return root;
|
||||
}
|
||||
|
||||
var ReactVersion = "18.3.0-www-modern-11df97fe";
|
||||
var ReactVersion = "18.3.0-www-modern-770d70a2";
|
||||
|
||||
// Might add PROFILE later.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user