Got this debugging another error. Filing here for reference. Original code: https://phabricator.intern.facebook.com/P59317705
if (__DEV__) {
      ReactDebugCurrentFiber.resetCurrentFiber();
    }
    if (__DEV__ && ReactFiberInstrumentation.debugTool) {
      ReactFiberInstrumentation.debugTool.onBeginWork(workInProgress);
    }
    if (next === null) {
      
      next = completeUnitOfWork(workInProgress);
    }
    ReactCurrentOwner.current = null;
    return next;
  }
  function workLoop(isAsync) {
    if (!isAsync) {
      
      while (nextUnitOfWork !== null) {
        nextUnitOfWork = performUnitOfWork(nextUnitOfWork);
      }
    } else {
      
      while (nextUnitOfWork !== null && !shouldYield()) {
        nextUnitOfWork = performUnitOfWork(nextUnitOfWork);
      }
    }
  }
  function renderRoot(
    root: FiberRoot,
    expirationTime: ExpirationTime,
    isAsync: boolean,