function renderElement(
    element, template, templateData = undefined, injectedData = undefined) {
  const output = /** @type {?SanitizedContent} */ (
      template(templateData || defaultTemplateData, injectedData));
  if (output && output.renderElement && element) {
    output.renderElement(element);
    return;
  }
  const html = ensureTemplateOutputHtml(output);
  safe.unsafeSetInnerHtmlDoNotUseOrElse(asserts.assert(element), html);
}
Renders a Soy template and then set the output string as
the innerHTML of an element. It is recommended to use this helper function
instead of directly setting innerHTML in your hand-written code, so that it
will be easier to audit the code for cross-site scripting vulnerabilities.
@param {?Element|?ShadowRoot} element The element whose content we are
    rendering into.
@param {function(ARG_TYPES, ?CompatibleIj=): *} template The Soy
    template defining the element's content.
@param {ARG_TYPES=} templateData The data for the template.
@param {?Object=} injectedData The injected data for the template.
@template ARG_TYPES