Skip to content

Commit

Permalink
Add ReactDOMClient to ServerIntegrationSelect (#28132)
Browse files Browse the repository at this point in the history
## Overview

Branched off #28130

## React for count changing
### Before
These tests are weird because on main they pass, but log to the console:

```
We expected 2 warning(s), but saw 1 warning(s).
We saw these warnings:
    Warning: Expected server HTML to contain a matching <select> in <div>.
        at select
```

The other one is ignored. The `expect(console.errors).toBeCalledWith(2)`
doesn't account for ignored calls, so the test passes with the two
expected (the +1 is in the test utiles). The ignored warning is

```
Warning: ReactDOM.hydrate is no longer supported in React 18. Use hydrateRoot instead.
```

So the mismatch is in the ignored warnings.

### After

After switching to `createRoot`, it still logs:

```
We expected 2 warning(s), but saw 1 warning(s).
We saw these warnings:
    Warning: Expected server HTML to contain a matching <select> in <div>.
        at select
```

But the test fails due to an unexpected error count. The new ignored
errors are:

```
Error: Uncaught [Error: Hydration failed because the initial UI does not match what was rendered on the server.]
Warning: An error occurred during hydration. The server HTML was replaced with client content in <div>.
Error: Hydration failed because the initial UI does not match what was rendered on the server.
Error: There was an error while hydrating. Because the error happened outside of a Suspense boundary, the entire root will switch to client rendering.
```

These seem to be the correct warnings to fire in `createRoot`, so the
fix is to update the number of warnings we expect.

DiffTrain build for commit c42e7c7.
  • Loading branch information
rickhanlonii committed Feb 1, 2024
1 parent 06365e8 commit 029d735
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 @@ -25622,7 +25622,7 @@ if (__DEV__) {
return root;
}

var ReactVersion = "18.3.0-canary-6054be9c8-20240201";
var ReactVersion = "18.3.0-canary-c42e7c7ad-20240201";

// Might add PROFILE later.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9149,7 +9149,7 @@ var devToolsConfig$jscomp$inline_1031 = {
throw Error("TestRenderer does not support findFiberByHostInstance()");
},
bundleType: 0,
version: "18.3.0-canary-6054be9c8-20240201",
version: "18.3.0-canary-c42e7c7ad-20240201",
rendererPackageName: "react-test-renderer"
};
var internals$jscomp$inline_1207 = {
Expand Down Expand Up @@ -9180,7 +9180,7 @@ var internals$jscomp$inline_1207 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-canary-6054be9c8-20240201"
reconcilerVersion: "18.3.0-canary-c42e7c7ad-20240201"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1208 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9577,7 +9577,7 @@ var devToolsConfig$jscomp$inline_1073 = {
throw Error("TestRenderer does not support findFiberByHostInstance()");
},
bundleType: 0,
version: "18.3.0-canary-6054be9c8-20240201",
version: "18.3.0-canary-c42e7c7ad-20240201",
rendererPackageName: "react-test-renderer"
};
var internals$jscomp$inline_1248 = {
Expand Down Expand Up @@ -9608,7 +9608,7 @@ var internals$jscomp$inline_1248 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-canary-6054be9c8-20240201"
reconcilerVersion: "18.3.0-canary-c42e7c7ad-20240201"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1249 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ if (__DEV__) {
) {
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
}
var ReactVersion = "18.3.0-canary-6054be9c8-20240201";
var ReactVersion = "18.3.0-canary-c42e7c7ad-20240201";

// ATTENTION
// When adding new symbols to this file,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -545,4 +545,4 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactCurrentDispatcher.current.useTransition();
};
exports.version = "18.3.0-canary-6054be9c8-20240201";
exports.version = "18.3.0-canary-c42e7c7ad-20240201";
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactCurrentDispatcher.current.useTransition();
};
exports.version = "18.3.0-canary-6054be9c8-20240201";
exports.version = "18.3.0-canary-c42e7c7ad-20240201";
"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 @@
6054be9c86f2e01e5e24c1fe2182479fec8667e4
c42e7c7adc3a036c0c176d5b3dd7cf9215862815

0 comments on commit 029d735

Please sign in to comment.