Skip to content

Commit

Permalink
Regression test for empty fragments
Browse files Browse the repository at this point in the history
This was also throwing before we added support for rendering undefined.
  • Loading branch information
eps1lon committed Mar 8, 2023
1 parent b25c813 commit efa8368
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions packages/react-client/src/__tests__/ReactFlight-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,22 @@ describe('ReactFlight', () => {
expect(ReactNoop).toMatchRenderedOutput(null);
});

it('can render an empty fragment', async () => {
function Empty() {
return <React.Fragment></React.Fragment>;
}

const model = <Empty />;

const transport = ReactNoopFlightServer.render(model);

await act(async () => {
ReactNoop.render(await ReactNoopFlightClient.read(transport));
});

expect(ReactNoop).toMatchRenderedOutput(null);
});

it('can render a lazy component as a shared component on the server', async () => {
function SharedComponent({text}) {
return (
Expand Down

0 comments on commit efa8368

Please sign in to comment.