Skip to content

Commit

Permalink
Remove ReactTestUtils from refs-destruction-test (#28532)
Browse files Browse the repository at this point in the history
```diff
-expect(ReactTestUtils.isDOMComponent(maybeElement)).toBe(true);
+expect(maybeElement).toBeInstanceOf(Element);
```

It's not equivalent since `isDOMComponent` checks `maybeElement.nodeType
=== Element.ELEMENT_NODE && !!maybeElement.tagName` but `instanceof`
check seems sufficient here. Checking `nodeType` is mostly for
cross-realm checks and checking falsy `tagName` seems like a check
specifically for incomplete DOM implementations because tagName can't be
empty by spec I believe.

DiffTrain build for commit 9c48fb2.
  • Loading branch information
eps1lon committed Mar 11, 2024
1 parent 064bfc9 commit 004bb7f
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25677,7 +25677,7 @@ if (__DEV__) {
return root;
}

var ReactVersion = "18.3.0-canary-7d6f1e3c1-20240311";
var ReactVersion = "18.3.0-canary-9c48fb25e-20240311";

// Might add PROFILE later.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9147,7 +9147,7 @@ var devToolsConfig$jscomp$inline_1016 = {
throw Error("TestRenderer does not support findFiberByHostInstance()");
},
bundleType: 0,
version: "18.3.0-canary-7d6f1e3c1-20240311",
version: "18.3.0-canary-9c48fb25e-20240311",
rendererPackageName: "react-test-renderer"
};
var internals$jscomp$inline_1194 = {
Expand Down Expand Up @@ -9178,7 +9178,7 @@ var internals$jscomp$inline_1194 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-canary-7d6f1e3c1-20240311"
reconcilerVersion: "18.3.0-canary-9c48fb25e-20240311"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1195 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9575,7 +9575,7 @@ var devToolsConfig$jscomp$inline_1058 = {
throw Error("TestRenderer does not support findFiberByHostInstance()");
},
bundleType: 0,
version: "18.3.0-canary-7d6f1e3c1-20240311",
version: "18.3.0-canary-9c48fb25e-20240311",
rendererPackageName: "react-test-renderer"
};
var internals$jscomp$inline_1235 = {
Expand Down Expand Up @@ -9606,7 +9606,7 @@ var internals$jscomp$inline_1235 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-canary-7d6f1e3c1-20240311"
reconcilerVersion: "18.3.0-canary-9c48fb25e-20240311"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1236 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ if (__DEV__) {
}
var dynamicFlags = require("ReactNativeInternalFeatureFlags");

var ReactVersion = "18.3.0-canary-7d6f1e3c1-20240311";
var ReactVersion = "18.3.0-canary-9c48fb25e-20240311";

// ATTENTION
// When adding new symbols to this file,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -628,4 +628,4 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactCurrentDispatcher.current.useTransition();
};
exports.version = "18.3.0-canary-7d6f1e3c1-20240311";
exports.version = "18.3.0-canary-9c48fb25e-20240311";
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,7 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactCurrentDispatcher.current.useTransition();
};
exports.version = "18.3.0-canary-7d6f1e3c1-20240311";
exports.version = "18.3.0-canary-9c48fb25e-20240311";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7d6f1e3c13686272c1d76813992d4e782fcb84e6
9c48fb25ecc467b37abb3e145c6e25e311dcdde5

0 comments on commit 004bb7f

Please sign in to comment.