code: function setAttributeToElement(element, attributeName, value) {
    if (value === null || typeof value === 'undefined') {
      element.removeAttribute(attributeName);
    } else {
      const text = String(value);
      // Avoid recursive attributeChangedCallback calls.
      if (element.getAttribute(attributeName) !== text) {
        element.setAttribute(attributeName, value);
      }
    }
  }
docs: Reflect the attribute to the given element. If the value is null, remove the attribute.