Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Improve suspense replaying forwardRef test
  • Loading branch information
hansottowirtz committed Apr 1, 2023
commit ec456e300eba44da88a03334533a8b01a69a0b52
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);
});
});