Skip to content

Commit

Permalink
Fix Flow types of useEffectEvent (#26468)
Browse files Browse the repository at this point in the history
## 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 commit d12bdcd.
  • Loading branch information
eps1lon committed Mar 25, 2023
1 parent 57fd488 commit e591dc4
Show file tree
Hide file tree
Showing 13 changed files with 23 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23743,7 +23743,7 @@ function createFiberRoot(
return root;
}

var ReactVersion = "18.3.0-next-73b6435ca-20230324";
var ReactVersion = "18.3.0-next-d12bdcda6-20230325";

// Might add PROFILE later.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8623,7 +8623,7 @@ var devToolsConfig$jscomp$inline_1002 = {
throw Error("TestRenderer does not support findFiberByHostInstance()");
},
bundleType: 0,
version: "18.3.0-next-73b6435ca-20230324",
version: "18.3.0-next-d12bdcda6-20230325",
rendererPackageName: "react-test-renderer"
};
var internals$jscomp$inline_1193 = {
Expand Down Expand Up @@ -8654,7 +8654,7 @@ var internals$jscomp$inline_1193 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-next-73b6435ca-20230324"
reconcilerVersion: "18.3.0-next-d12bdcda6-20230325"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1194 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9048,7 +9048,7 @@ var devToolsConfig$jscomp$inline_1045 = {
throw Error("TestRenderer does not support findFiberByHostInstance()");
},
bundleType: 0,
version: "18.3.0-next-73b6435ca-20230324",
version: "18.3.0-next-d12bdcda6-20230325",
rendererPackageName: "react-test-renderer"
};
var internals$jscomp$inline_1234 = {
Expand Down Expand Up @@ -9079,7 +9079,7 @@ var internals$jscomp$inline_1234 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-next-73b6435ca-20230324"
reconcilerVersion: "18.3.0-next-d12bdcda6-20230325"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1235 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ if (
}
"use strict";

var ReactVersion = "18.3.0-next-73b6435ca-20230324";
var ReactVersion = "18.3.0-next-d12bdcda6-20230325";

// ATTENTION
// When adding new symbols to this file,
Expand Down Expand Up @@ -2071,22 +2071,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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -639,4 +639,4 @@ exports.useSyncExternalStore = function (
);
};
exports.useTransition = useTransition;
exports.version = "18.3.0-next-73b6435ca-20230324";
exports.version = "18.3.0-next-d12bdcda6-20230325";
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,7 @@ exports.useSyncExternalStore = function (
);
};
exports.useTransition = useTransition;
exports.version = "18.3.0-next-73b6435ca-20230324";
exports.version = "18.3.0-next-d12bdcda6-20230325";

/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
if (
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
73b6435ca4e0c3ae3aac8126509a82420a84f0d7
d12bdcda69afd219f4d91cbd60d6fae2a375d35b
Original file line number Diff line number Diff line change
Expand Up @@ -27008,7 +27008,7 @@ function createFiberRoot(
return root;
}

var ReactVersion = "18.3.0-next-73b6435ca-20230324";
var ReactVersion = "18.3.0-next-d12bdcda6-20230325";

function createPortal$1(
children,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9490,7 +9490,7 @@ var roots = new Map(),
devToolsConfig$jscomp$inline_1022 = {
findFiberByHostInstance: getInstanceFromNode,
bundleType: 0,
version: "18.3.0-next-73b6435ca-20230324",
version: "18.3.0-next-d12bdcda6-20230325",
rendererPackageName: "react-native-renderer",
rendererConfig: {
getInspectorDataForViewTag: function () {
Expand Down Expand Up @@ -9532,7 +9532,7 @@ var internals$jscomp$inline_1268 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-next-73b6435ca-20230324"
reconcilerVersion: "18.3.0-next-d12bdcda6-20230325"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1269 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10198,7 +10198,7 @@ var roots = new Map(),
devToolsConfig$jscomp$inline_1101 = {
findFiberByHostInstance: getInstanceFromNode,
bundleType: 0,
version: "18.3.0-next-73b6435ca-20230324",
version: "18.3.0-next-d12bdcda6-20230325",
rendererPackageName: "react-native-renderer",
rendererConfig: {
getInspectorDataForViewTag: function () {
Expand Down Expand Up @@ -10253,7 +10253,7 @@ var roots = new Map(),
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-next-73b6435ca-20230324"
reconcilerVersion: "18.3.0-next-d12bdcda6-20230325"
});
exports.createPortal = function (children, containerTag) {
return createPortal$1(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27548,7 +27548,7 @@ function createFiberRoot(
return root;
}

var ReactVersion = "18.3.0-next-73b6435ca-20230324";
var ReactVersion = "18.3.0-next-d12bdcda6-20230325";

function createPortal$1(
children,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9746,7 +9746,7 @@ var roots = new Map(),
devToolsConfig$jscomp$inline_1081 = {
findFiberByHostInstance: getInstanceFromTag,
bundleType: 0,
version: "18.3.0-next-73b6435ca-20230324",
version: "18.3.0-next-d12bdcda6-20230325",
rendererPackageName: "react-native-renderer",
rendererConfig: {
getInspectorDataForViewTag: function () {
Expand Down Expand Up @@ -9788,7 +9788,7 @@ var internals$jscomp$inline_1334 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-next-73b6435ca-20230324"
reconcilerVersion: "18.3.0-next-d12bdcda6-20230325"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1335 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10454,7 +10454,7 @@ var roots = new Map(),
devToolsConfig$jscomp$inline_1160 = {
findFiberByHostInstance: getInstanceFromTag,
bundleType: 0,
version: "18.3.0-next-73b6435ca-20230324",
version: "18.3.0-next-d12bdcda6-20230325",
rendererPackageName: "react-native-renderer",
rendererConfig: {
getInspectorDataForViewTag: function () {
Expand Down Expand Up @@ -10509,7 +10509,7 @@ var roots = new Map(),
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-next-73b6435ca-20230324"
reconcilerVersion: "18.3.0-next-d12bdcda6-20230325"
});
exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = {
computeComponentStackForErrorReporting: function (reactTag) {
Expand Down

0 comments on commit e591dc4

Please sign in to comment.