File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
packages/react-reconciler/src/__tests__ Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -1479,14 +1479,20 @@ describe('ReactUse', () => {
14791479 const promiseC = Promise . resolve ( 'C' ) ;
14801480
14811481 const Async = React . forwardRef ( ( props , ref ) => {
1482+ React . useImperativeHandle ( ref , ( ) => ( { } ) ) ;
14821483 const text = use ( promiseA ) + use ( promiseB ) + use ( promiseC ) ;
14831484 return < Text text = { text } /> ;
14841485 } ) ;
14851486
1487+ let _ref ;
14861488 function App ( ) {
1489+ const ref = arg => {
1490+ _ref = arg ;
1491+ } ;
1492+
14871493 return (
14881494 < Suspense fallback = { < Text text = "Loading..." /> } >
1489- < Async />
1495+ < Async ref = { ref } />
14901496 </ Suspense >
14911497 ) ;
14921498 }
@@ -1499,5 +1505,6 @@ describe('ReactUse', () => {
14991505 } ) ;
15001506 assertLog ( [ 'ABC' ] ) ;
15011507 expect ( root ) . toMatchRenderedOutput ( 'ABC' ) ;
1508+ expect ( _ref ) . toBeDefined ( ) ;
15021509 } ) ;
15031510} ) ;
You can’t perform that action at this time.
0 commit comments