function isDeclaredInComponent(node, names) {
      while (node) {
        const component = components.get(node);

        const isDeclared = component && component.confidence >= 2
          && internalIsDeclaredInComponent(component.declaredPropTypes || {}, names);

        if (isDeclared) {
          return true;
        }

        node = node.parent;
      }
      return false;
    }
Checks if the prop is declared
@param {ASTNode} node The AST node being checked.
@param {string[]} names List of names of the prop to check.
@returns {boolean} True if the prop is declared, false if not.