Skip to content

Commit a8b6d3f

Browse files
committed
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 [d12bdcd](d12bdcd)
1 parent 390ac45 commit a8b6d3f

File tree

5 files changed

+15
-15
lines changed

5 files changed

+15
-15
lines changed

compiled/facebook-www/REVISION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
73b6435ca4e0c3ae3aac8126509a82420a84f0d7
1+
d12bdcda69afd219f4d91cbd60d6fae2a375d35b

compiled/facebook-www/React-dev.classic.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ if (
2727
}
2828
"use strict";
2929

30-
var ReactVersion = "18.3.0-www-classic-e762d1a9";
30+
var ReactVersion = "18.3.0-www-classic-1745b9a1";
3131

3232
// ATTENTION
3333
// When adding new symbols to this file,
@@ -2011,22 +2011,22 @@ function useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {
20112011
);
20122012
}
20132013
function useCacheRefresh() {
2014-
var dispatcher = resolveDispatcher(); // $FlowFixMe This is unstable, thus optional
2014+
var dispatcher = resolveDispatcher(); // $FlowFixMe[not-a-function] This is unstable, thus optional
20152015

20162016
return dispatcher.useCacheRefresh();
20172017
}
20182018
function use(usable) {
2019-
var dispatcher = resolveDispatcher(); // $FlowFixMe This is unstable, thus optional
2019+
var dispatcher = resolveDispatcher(); // $FlowFixMe[not-a-function] This is unstable, thus optional
20202020

20212021
return dispatcher.use(usable);
20222022
}
20232023
function useMemoCache(size) {
2024-
var dispatcher = resolveDispatcher(); // $FlowFixMe This is unstable, thus optional
2024+
var dispatcher = resolveDispatcher(); // $FlowFixMe[not-a-function] This is unstable, thus optional
20252025

20262026
return dispatcher.useMemoCache(size);
20272027
}
20282028
function useEffectEvent(callback) {
2029-
var dispatcher = resolveDispatcher(); // $FlowFixMe This is unstable, thus optional
2029+
var dispatcher = resolveDispatcher(); // $FlowFixMe[not-a-function] This is unstable, thus optional
20302030

20312031
return dispatcher.useEffectEvent(callback);
20322032
}

compiled/facebook-www/React-dev.modern.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ if (
2727
}
2828
"use strict";
2929

30-
var ReactVersion = "18.3.0-www-modern-11df97fe";
30+
var ReactVersion = "18.3.0-www-modern-770d70a2";
3131

3232
// ATTENTION
3333
// When adding new symbols to this file,
@@ -2011,22 +2011,22 @@ function useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {
20112011
);
20122012
}
20132013
function useCacheRefresh() {
2014-
var dispatcher = resolveDispatcher(); // $FlowFixMe This is unstable, thus optional
2014+
var dispatcher = resolveDispatcher(); // $FlowFixMe[not-a-function] This is unstable, thus optional
20152015

20162016
return dispatcher.useCacheRefresh();
20172017
}
20182018
function use(usable) {
2019-
var dispatcher = resolveDispatcher(); // $FlowFixMe This is unstable, thus optional
2019+
var dispatcher = resolveDispatcher(); // $FlowFixMe[not-a-function] This is unstable, thus optional
20202020

20212021
return dispatcher.use(usable);
20222022
}
20232023
function useMemoCache(size) {
2024-
var dispatcher = resolveDispatcher(); // $FlowFixMe This is unstable, thus optional
2024+
var dispatcher = resolveDispatcher(); // $FlowFixMe[not-a-function] This is unstable, thus optional
20252025

20262026
return dispatcher.useMemoCache(size);
20272027
}
20282028
function useEffectEvent(callback) {
2029-
var dispatcher = resolveDispatcher(); // $FlowFixMe This is unstable, thus optional
2029+
var dispatcher = resolveDispatcher(); // $FlowFixMe[not-a-function] This is unstable, thus optional
20302030

20312031
return dispatcher.useEffectEvent(callback);
20322032
}

compiled/facebook-www/ReactDOMTesting-prod.modern.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -15987,7 +15987,7 @@ Internals.Events = [
1598715987
var devToolsConfig$jscomp$inline_1754 = {
1598815988
findFiberByHostInstance: getClosestInstanceFromNode,
1598915989
bundleType: 0,
15990-
version: "18.3.0-www-modern-11df97fe",
15990+
version: "18.3.0-www-modern-770d70a2",
1599115991
rendererPackageName: "react-dom"
1599215992
};
1599315993
var internals$jscomp$inline_2154 = {
@@ -16018,7 +16018,7 @@ var internals$jscomp$inline_2154 = {
1601816018
scheduleRoot: null,
1601916019
setRefreshHandler: null,
1602016020
getCurrentFiber: null,
16021-
reconcilerVersion: "18.3.0-www-modern-11df97fe"
16021+
reconcilerVersion: "18.3.0-www-modern-770d70a2"
1602216022
};
1602316023
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
1602416024
var hook$jscomp$inline_2155 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -16338,4 +16338,4 @@ exports.unstable_createEventHandle = function (type, options) {
1633816338
return eventHandle;
1633916339
};
1634016340
exports.unstable_runWithPriority = runWithPriority;
16341-
exports.version = "18.3.0-www-modern-11df97fe";
16341+
exports.version = "18.3.0-www-modern-770d70a2";

compiled/facebook-www/ReactTestRenderer-dev.modern.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -24353,7 +24353,7 @@ function createFiberRoot(
2435324353
return root;
2435424354
}
2435524355

24356-
var ReactVersion = "18.3.0-www-modern-11df97fe";
24356+
var ReactVersion = "18.3.0-www-modern-770d70a2";
2435724357

2435824358
// Might add PROFILE later.
2435924359

0 commit comments

Comments
 (0)