addMessages(messages) {
    if (!messages) {
      return;
    }

    // Standardize on array of objects for message.
    if (typeof messages === 'string') {
      messages = {
        messages,
        level: 'error',
      };
    }

    if (!Array.isArray(messages)) {
      messages = [messages];
    }

    messages = _.uniqBy(messages, message => message.message);

    if (this.refs.messageContainer) {
      this.setContent(this.refs.messageContainer, messages.map((message) => {
        return this.renderTemplate('message', { ...message });
      }
      ).join(''));
    }
  }
Add a new input error to this element.
@param {Array<object>|string} messages - An array of messages to add to the element.
@returns {void}