async findQualifiedChildrenFromList(instances, depth) {
    instances = instances.filter(child => {
      var _a;

      return !(0, util_1.isBeingDestroyed)(child) && !((_a = child.type.devtools) === null || _a === void 0 ? void 0 : _a.hide);
    });

    if (!this.componentFilter.filter) {
      return Promise.all(instances.map((child, index, list) => this.capture(child, list, depth)));
    } else {
      return Array.prototype.concat.apply([], await Promise.all(instances.map(i => this.findQualifiedChildren(i, depth))));
    }
  }
Iterate through an array of instances and flatten it into
an array of qualified instances. This is a depth-first
traversal - e.g. if an instance is not matched, we will
recursively go deeper until a qualified child is found.

@param {Array} instances
@return {Array}