Got this debugging another error. Filing here for reference. Original code: https://phabricator.intern.facebook.com/P59317705
if (deadline === null) {
      return false;
    }
    if (deadline.timeRemaining() > timeHeuristicForUnitOfWork) {
      
      
      return false;
    }
    deadlineDidExpire = true;
    return true;
  }
  function onUncaughtError(error) {
    invariant(
      nextFlushedRoot !== null,
      'Should be working on a root. This error is likely caused by a bug in ' +
        'React. Please file an issue.',
    );
    
    
    nextFlushedRoot.remainingExpirationTime = NoWork;
    if (!hasUnhandledError) {
      hasUnhandledError = true;
      unhandledError = error;
    }
  }
  
  
  function batchedUpdates<A, R>(fn: (a: A) => R, a: A): R {