@@ -18,7 +18,6 @@ import type { HostConfig } from 'ReactFiberReconciler';
1818import type { ReifiedYield } from 'ReactReifiedYield' ;
1919
2020var { reconcileChildFibers } = require ( 'ReactChildFiber' ) ;
21- var { popContextProvider } = require ( 'ReactFiberContext' ) ;
2221var ReactTypeOfWork = require ( 'ReactTypeOfWork' ) ;
2322var ReactTypeOfSideEffect = require ( 'ReactTypeOfSideEffect' ) ;
2423var {
@@ -121,11 +120,10 @@ module.exports = function<T, P, I, TI, C>(config : HostConfig<T, P, I, TI, C>) {
121120
122121 function completeWork ( current : ?Fiber , workInProgress : Fiber ) : ?Fiber {
123122 switch ( workInProgress . tag ) {
124- case FunctionalComponent : {
123+ case FunctionalComponent :
125124 transferOutput ( workInProgress . child , workInProgress ) ;
126125 return null ;
127- }
128- case ClassComponent : {
126+ case ClassComponent :
129127 transferOutput ( workInProgress . child , workInProgress ) ;
130128 // Don't use the state queue to compute the memoized state. We already
131129 // merged it and assigned it to the instance. Transfer it from there.
@@ -150,13 +148,8 @@ module.exports = function<T, P, I, TI, C>(config : HostConfig<T, P, I, TI, C>) {
150148 workInProgress . callbackList = updateQueue ;
151149 markCallback ( workInProgress ) ;
152150 }
153- const instance = workInProgress . stateNode ;
154- if ( typeof instance . getChildContext === 'function' ) {
155- popContextProvider ( ) ;
156- }
157151 return null ;
158- }
159- case HostContainer : {
152+ case HostContainer :
160153 transferOutput ( workInProgress . child , workInProgress ) ;
161154 // We don't know if a container has updated any children so we always
162155 // need to update it right now. We schedule this side-effect before
@@ -165,8 +158,7 @@ module.exports = function<T, P, I, TI, C>(config : HostConfig<T, P, I, TI, C>) {
165158 // are invoked.
166159 markUpdate ( workInProgress ) ;
167160 return null ;
168- }
169- case HostComponent : {
161+ case HostComponent :
170162 let newProps = workInProgress . pendingProps ;
171163 if ( current && workInProgress . stateNode != null ) {
172164 // If we have an alternate, that means this is an update and we need to
@@ -208,8 +200,7 @@ module.exports = function<T, P, I, TI, C>(config : HostConfig<T, P, I, TI, C>) {
208200 }
209201 workInProgress . memoizedProps = newProps ;
210202 return null ;
211- }
212- case HostText : {
203+ case HostText :
213204 let newText = workInProgress . pendingProps ;
214205 if ( current && workInProgress . stateNode != null ) {
215206 // If we have an alternate, that means this is an update and we need to
@@ -231,32 +222,25 @@ module.exports = function<T, P, I, TI, C>(config : HostConfig<T, P, I, TI, C>) {
231222 }
232223 workInProgress . memoizedProps = newText ;
233224 return null ;
234- }
235- case CoroutineComponent : {
225+ case CoroutineComponent :
236226 return moveCoroutineToHandlerPhase ( current , workInProgress ) ;
237- }
238- case CoroutineHandlerPhase : {
227+ case CoroutineHandlerPhase :
239228 transferOutput ( workInProgress . stateNode , workInProgress ) ;
240229 // Reset the tag to now be a first phase coroutine.
241230 workInProgress . tag = CoroutineComponent ;
242231 return null ;
243- }
244- case YieldComponent : {
232+ case YieldComponent :
245233 // Does nothing.
246234 return null ;
247- }
248- case Fragment : {
235+ case Fragment :
249236 transferOutput ( workInProgress . child , workInProgress ) ;
250237 return null ;
251- }
252238
253239 // Error cases
254- case IndeterminateComponent : {
240+ case IndeterminateComponent :
255241 throw new Error ( 'An indeterminate component should have become determinate before completing.' ) ;
256- }
257- default : {
242+ default :
258243 throw new Error ( 'Unknown unit of work tag' ) ;
259- }
260244 }
261245 }
262246
0 commit comments