File tree Expand file tree Collapse file tree 3 files changed +15
-3
lines changed
src/renderers/shared/shared/__tests__ Expand file tree Collapse file tree 3 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -110,7 +110,6 @@ src/renderers/shared/shared/__tests__/ReactStatelessComponent-test.js
110110* should warn when using non-React functions in JSX
111111
112112src/renderers/shared/shared/__tests__/ReactUpdates-test.js
113- * should queue mount-ready handlers across different roots
114113* marks top-level updates
115114* throws in setState if the update callback is not a function
116115* throws in replaceState if the update callback is not a function
Original file line number Diff line number Diff line change @@ -1451,6 +1451,7 @@ src/renderers/shared/shared/__tests__/ReactUpdates-test.js
14511451* should not reconcile children passed via props
14521452* should flow updates correctly
14531453* should share reconcile transaction across different roots
1454+ * should queue mount-ready handlers across different roots
14541455* should flush updates in the correct order
14551456* should flush updates in the correct order across roots
14561457* should queue nested updates
Original file line number Diff line number Diff line change @@ -544,6 +544,8 @@ describe('ReactUpdates', () => {
544544 // componentDidUpdate handlers is called, B's DOM should already have been
545545 // updated.
546546
547+ var bContainer = document . createElement ( 'div' ) ;
548+
547549 var a ;
548550 var b ;
549551
@@ -558,7 +560,15 @@ describe('ReactUpdates', () => {
558560 }
559561
560562 render ( ) {
561- return < div > A{ this . state . x } </ div > ;
563+ var portal = null ;
564+ // If we're using Fiber, we use Portals instead to achieve this.
565+ if ( ReactDOMFeatureFlags . useFiber ) {
566+ portal = ReactDOM . unstable_createPortal (
567+ < B ref = { n => b = n } /> ,
568+ bContainer
569+ ) ;
570+ }
571+ return < div > A{ this . state . x } { portal } </ div > ;
562572 }
563573 }
564574
@@ -571,7 +581,9 @@ describe('ReactUpdates', () => {
571581 }
572582
573583 a = ReactTestUtils . renderIntoDocument ( < A /> ) ;
574- b = ReactTestUtils . renderIntoDocument ( < B /> ) ;
584+ if ( ! ReactDOMFeatureFlags . useFiber ) {
585+ ReactDOM . render ( < B ref = { n => b = n } /> , bContainer ) ;
586+ }
575587
576588 ReactDOM . unstable_batchedUpdates ( function ( ) {
577589 a . setState ( { x : 1 } ) ;
You can’t perform that action at this time.
0 commit comments