Skip to content

Commit

Permalink
Improve suspense replaying forwardRef test
Browse files Browse the repository at this point in the history
  • Loading branch information
hansottowirtz committed Apr 2, 2023
1 parent 5f0fbbf commit 58dd0f4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/react-reconciler/src/__tests__/ReactUse-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1478,8 +1478,10 @@ describe('ReactUse', () => {
const promiseB = Promise.resolve('B');
const promiseC = Promise.resolve('C');

const refSymbol = {};

const Async = React.forwardRef((props, ref) => {
React.useImperativeHandle(ref, () => ({}));
React.useImperativeHandle(ref, () => refSymbol);
const text = use(promiseA) + use(promiseB) + use(promiseC);
return <Text text={text} />;
});
Expand All @@ -1505,6 +1507,6 @@ describe('ReactUse', () => {
});
assertLog(['ABC']);
expect(root).toMatchRenderedOutput('ABC');
expect(_ref).toBeDefined();
expect(_ref).toBe(refSymbol);
});
});

0 comments on commit 58dd0f4

Please sign in to comment.