Skip to content

Commit 436c433

Browse files
committed
No fallback to client render in www
1 parent 5119374 commit 436c433

File tree

1 file changed

+20
-10
lines changed

1 file changed

+20
-10
lines changed

packages/react-dom/src/__tests__/ReactDOMHydrationDiff-test.js

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -127,16 +127,26 @@ describe('ReactDOMServerHydration', () => {
127127
}
128128

129129
/* eslint-disable no-irregular-whitespace */
130-
expect(testMismatch(Mismatch)).toMatchInlineSnapshot(`
131-
[
132-
"Warning: Text content did not match. Server: "This markup contains an nbsp entity:   server text" Client: "This markup contains an nbsp entity:   client text"
133-
in div (at **)
134-
in Mismatch (at **)",
135-
"Warning: An error occurred during hydration. The server HTML was replaced with client content in <div>.",
136-
"Caught [Text content does not match server-rendered HTML.]",
137-
"Caught [There was an error while hydrating. Because the error happened outside of a Suspense boundary, the entire root will switch to client rendering.]",
138-
]
139-
`);
130+
if (gate(flags => flags.enableClientRenderFallbackOnTextMismatch)) {
131+
expect(testMismatch(Mismatch)).toMatchInlineSnapshot(`
132+
[
133+
"Warning: Text content did not match. Server: "This markup contains an nbsp entity:   server text" Client: "This markup contains an nbsp entity:   client text"
134+
in div (at **)
135+
in Mismatch (at **)",
136+
"Warning: An error occurred during hydration. The server HTML was replaced with client content in <div>.",
137+
"Caught [Text content does not match server-rendered HTML.]",
138+
"Caught [There was an error while hydrating. Because the error happened outside of a Suspense boundary, the entire root will switch to client rendering.]",
139+
]
140+
`);
141+
} else {
142+
expect(testMismatch(Mismatch)).toMatchInlineSnapshot(`
143+
[
144+
"Warning: Text content did not match. Server: "This markup contains an nbsp entity:   server text" Client: "This markup contains an nbsp entity:   client text"
145+
in div (at **)
146+
in Mismatch (at **)",
147+
]
148+
`);
149+
}
140150
/* eslint-enable no-irregular-whitespace */
141151
});
142152

0 commit comments

Comments
 (0)