@@ -102,7 +102,7 @@ module.exports = function<T, P, I, TI, PI, C, CX, PL>(
102102 // We now have clones. Let's store them as the currently progressed work.
103103 workInProgress . progressedChild = workInProgress . child ;
104104 workInProgress . progressedPriority = priorityLevel ;
105- if ( current ) {
105+ if ( current !== null ) {
106106 // We also store it on the current. When the alternate swaps in we can
107107 // continue from this point.
108108 current . progressedChild = workInProgress . progressedChild ;
@@ -131,7 +131,7 @@ module.exports = function<T, P, I, TI, PI, C, CX, PL>(
131131 // At this point any memoization is no longer valid since we'll have changed
132132 // the children.
133133 workInProgress . memoizedProps = null ;
134- if ( ! current ) {
134+ if ( current === null ) {
135135 // If this is a fresh new component that hasn't been rendered yet, we
136136 // won't update its child set by applying minimal side-effects. Instead,
137137 // we will add them all to the child before it gets rendered. That means
@@ -191,9 +191,9 @@ module.exports = function<T, P, I, TI, PI, C, CX, PL>(
191191 return workInProgress . child ;
192192 }
193193
194- function markRef ( current : ? Fiber , workInProgress : Fiber ) {
194+ function markRef ( current : Fiber | null , workInProgress : Fiber ) {
195195 const ref = workInProgress . ref ;
196- if ( ref && ( ! current || current . ref !== ref ) ) {
196+ if ( ref !== null && ( ! current || current . ref !== ref ) ) {
197197 // Schedule a Ref effect
198198 workInProgress . effectTag |= Ref ;
199199 }
@@ -211,7 +211,7 @@ module.exports = function<T, P, I, TI, PI, C, CX, PL>(
211211 nextProps = memoizedProps ;
212212 }
213213 } else {
214- if ( nextProps == null || memoizedProps === nextProps ) {
214+ if ( nextProps === null || memoizedProps === nextProps ) {
215215 return bailoutOnAlreadyFinishedWork ( current , workInProgress ) ;
216216 }
217217 // TODO: Disable this before release, since it is not part of the public API
@@ -240,14 +240,14 @@ module.exports = function<T, P, I, TI, PI, C, CX, PL>(
240240 return workInProgress . child ;
241241 }
242242
243- function updateClassComponent ( current : ? Fiber , workInProgress : Fiber , priorityLevel : PriorityLevel ) {
243+ function updateClassComponent ( current : Fiber | null , workInProgress : Fiber , priorityLevel : PriorityLevel ) {
244244 // Push context providers early to prevent context stack mismatches.
245245 // During mounting we don't know the child context yet as the instance doesn't exist.
246246 // We will invalidate the child context in finishClassComponent() right after rendering.
247247 const hasContext = pushContextProvider ( workInProgress ) ;
248248
249249 let shouldUpdate ;
250- if ( ! current ) {
250+ if ( current === null ) {
251251 if ( ! workInProgress . stateNode ) {
252252 // In the initial pass we might need to construct the instance.
253253 constructClassInstance ( workInProgress ) ;
@@ -264,7 +264,7 @@ module.exports = function<T, P, I, TI, PI, C, CX, PL>(
264264 }
265265
266266 function finishClassComponent (
267- current : ? Fiber ,
267+ current : Fiber | null ,
268268 workInProgress : Fiber ,
269269 shouldUpdate : boolean ,
270270 hasContext : boolean ,
@@ -314,7 +314,7 @@ module.exports = function<T, P, I, TI, PI, C, CX, PL>(
314314 pushHostContainer ( workInProgress , root . containerInfo ) ;
315315
316316 const updateQueue = workInProgress . updateQueue ;
317- if ( updateQueue ) {
317+ if ( updateQueue !== null ) {
318318 const prevState = workInProgress . memoizedState ;
319319 const state = beginUpdateQueue ( workInProgress , updateQueue , null , prevState , null , priorityLevel ) ;
320320 if ( prevState === state ) {
@@ -335,7 +335,7 @@ module.exports = function<T, P, I, TI, PI, C, CX, PL>(
335335 pushHostContext ( workInProgress ) ;
336336
337337 let nextProps = workInProgress . pendingProps ;
338- const prevProps = current ? current . memoizedProps : null ;
338+ const prevProps = current !== null ? current . memoizedProps : null ;
339339 const memoizedProps = workInProgress . memoizedProps ;
340340 if ( hasContextChanged ( ) ) {
341341 // Normally we can bail out on props equality but if context has changed
@@ -359,7 +359,7 @@ module.exports = function<T, P, I, TI, PI, C, CX, PL>(
359359 // that is a bit tricky since workInProgress and current can have
360360 // different "hidden" settings.
361361 let child = workInProgress . progressedChild ;
362- while ( child ) {
362+ while ( child !== null ) {
363363 // To ensure that this subtree gets its priority reset, the children
364364 // need to be reset.
365365 child . pendingWorkPriority = OffscreenPriority ;
@@ -409,16 +409,16 @@ module.exports = function<T, P, I, TI, PI, C, CX, PL>(
409409 // Reconcile the children and stash them for later work.
410410 reconcileChildrenAtPriority ( current , workInProgress , nextChildren , OffscreenPriority ) ;
411411 memoizeProps ( workInProgress , nextProps ) ;
412- workInProgress . child = current ? current . child : null ;
412+ workInProgress . child = current !== null ? current . child : null ;
413413
414- if ( ! current ) {
414+ if ( current === null ) {
415415 // If this doesn't have a current we won't track it for placement
416416 // effects. However, when we come back around to this we have already
417417 // inserted the parent which means that we'll infact need to make this a
418418 // placement.
419419 // TODO: There has to be a better solution to this problem.
420420 let child = workInProgress . progressedChild ;
421- while ( child ) {
421+ while ( child !== null ) {
422422 child . effectTag = Placement ;
423423 child = child . sibling ;
424424 }
@@ -464,7 +464,7 @@ module.exports = function<T, P, I, TI, PI, C, CX, PL>(
464464 value = fn ( props , context ) ;
465465 }
466466
467- if ( typeof value === 'object' && value && typeof value . render === 'function' ) {
467+ if ( typeof value === 'object' && value !== null && typeof value . render === 'function' ) {
468468 // Proceed under the assumption that this is a class instance
469469 workInProgress . tag = ClassComponent ;
470470
@@ -479,7 +479,7 @@ module.exports = function<T, P, I, TI, PI, C, CX, PL>(
479479 // Proceed under the assumption that this is a functional component
480480 workInProgress . tag = FunctionalComponent ;
481481 if ( __DEV__ ) {
482- if ( workInProgress . ref != null ) {
482+ if ( workInProgress . ref !== null ) {
483483 let info = '' ;
484484 const ownerName = ReactDebugCurrentFiber . getCurrentFiberOwnerName ( ) ;
485485 if ( ownerName ) {
@@ -517,7 +517,7 @@ module.exports = function<T, P, I, TI, PI, C, CX, PL>(
517517 if ( nextCoroutine === null ) {
518518 nextCoroutine = current && current . memoizedProps ;
519519 invariant (
520- nextCoroutine != null ,
520+ nextCoroutine !== null ,
521521 'We should always have pending or current props. This error is ' +
522522 'likely caused by a bug in React. Please file an issue.'
523523 ) ;
@@ -538,7 +538,7 @@ module.exports = function<T, P, I, TI, PI, C, CX, PL>(
538538 // At this point any memoization is no longer valid since we'll have changed
539539 // the children.
540540 workInProgress . memoizedProps = null ;
541- if ( ! current ) {
541+ if ( current === null ) {
542542 workInProgress . stateNode = mountChildFibersInPlace (
543543 workInProgress ,
544544 workInProgress . stateNode ,
@@ -592,7 +592,7 @@ module.exports = function<T, P, I, TI, PI, C, CX, PL>(
592592 return bailoutOnAlreadyFinishedWork ( current , workInProgress ) ;
593593 }
594594
595- if ( ! current ) {
595+ if ( current === null ) {
596596 // Portals are special because we don't append the children during mount
597597 // but at commit. Therefore we need to track insertions which the normal
598598 // flow doesn't do during mount. This doesn't happen at the root because
@@ -632,7 +632,7 @@ module.exports = function<T, P, I, TI, PI, C, CX, PL>(
632632 }
633633 */
634634
635- function bailoutOnAlreadyFinishedWork ( current , workInProgress : Fiber ) : ? Fiber {
635+ function bailoutOnAlreadyFinishedWork ( current , workInProgress : Fiber ) : Fiber | null {
636636 const priorityLevel = workInProgress . pendingWorkPriority ;
637637 // TODO: We should ideally be able to bail out early if the children have no
638638 // more work to do. However, since we don't have a separation of this
@@ -687,7 +687,7 @@ module.exports = function<T, P, I, TI, PI, C, CX, PL>(
687687 // is handled by beginUpdateQueue.
688688 }
689689
690- function beginWork ( current : ? Fiber , workInProgress : Fiber , priorityLevel : PriorityLevel ) : ? Fiber {
690+ function beginWork ( current : Fiber | null , workInProgress : Fiber , priorityLevel : PriorityLevel ) : Fiber | null {
691691 if ( workInProgress . pendingWorkPriority === NoWork ||
692692 workInProgress . pendingWorkPriority > priorityLevel ) {
693693 return bailoutOnLowPriority ( current , workInProgress ) ;
@@ -744,7 +744,7 @@ module.exports = function<T, P, I, TI, PI, C, CX, PL>(
744744 }
745745 }
746746
747- function beginFailedWork ( current : ? Fiber , workInProgress : Fiber , priorityLevel : PriorityLevel ) {
747+ function beginFailedWork ( current : Fiber | null , workInProgress : Fiber , priorityLevel : PriorityLevel ) {
748748 invariant (
749749 workInProgress . tag === ClassComponent ||
750750 workInProgress . tag === HostRoot ,
0 commit comments