Skip to content

Commit b593b64

Browse files
committed
Regression test for empty fragments
This was also throwing before we added support for rendering undefined.
1 parent 03bea63 commit b593b64

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

packages/react-client/src/__tests__/ReactFlight-test.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,22 @@ describe('ReactFlight', () => {
213213
expect(ReactNoop).toMatchRenderedOutput(null);
214214
});
215215

216+
it('can render an empty fragment', async () => {
217+
function Empty() {
218+
return <React.Fragment></React.Fragment>;
219+
}
220+
221+
const model = <Empty />;
222+
223+
const transport = ReactNoopFlightServer.render(model);
224+
225+
await act(async () => {
226+
ReactNoop.render(await ReactNoopFlightClient.read(transport));
227+
});
228+
229+
expect(ReactNoop).toMatchRenderedOutput(null);
230+
});
231+
216232
it('can render a lazy component as a shared component on the server', async () => {
217233
function SharedComponent({text}) {
218234
return (

0 commit comments

Comments
 (0)