verifyPreviousRefsResolved(flushedKey) {
    const originalKeys = this.getOriginalKeys();
    for (let i = 0; i < originalKeys.length; i++) {
      const key = originalKeys[i];
      if (key === flushedKey) {
        // We are only interested in children up to the current key.
        return;
      }
      expect(this.displays[key]).toBeTruthy();
    }
  }
Verifies that by the time a child is flushed, the refs that appeared
earlier have already been resolved.
TODO: This assumption will likely break with incremental reconciler
but our internal layer API depends on this assumption. We need to change
it to be more declarative before making ref resolution indeterministic.