static createVirtualElement (type, props, ...children) {
    const renderingContext = _getRenderingContext()
    const createElement = renderingContext.$$
    const _props = {}
    let _class = null
    const _styles = null
    const _attributes = {}
    const _htmlProps = {}
    const _eventListeners = []
    let _ref = null
    if (props) {
      const keys = Object.keys(props)
      for (const key of keys) {
        if (!hasOwnProperty(props, key)) continue
        const val = props[key]
        // ATTENTION: assuming that all event handlers start with 'on'
        const m = /^on([A-Za-z]+)$/.exec(key)
        if (m) {
          // ATTENTION: IMO all native events are lower case
          _eventListeners.push([m[1].toLowerCase(), val])
        } else if (key === 'ref') {
          _ref = val
        } else if (isString(type)) {
          switch (key) {
            case 'class':
            case 'className': {
              _class = val
              break
            }
            case 'style': {
              if (!isString(val)) {
                throw new Error('HTML attribute "style" must be a CSS string.')
              }
              _attributes.style = val
              break
            }
            // ATTENTION: this list is utterly incomplete and IMO even incorrect
            // TODO: Would need a complete list of 'reflected' properties, i.e. properties that are identical to attributes
            // vs those who are only initialized with the attribute value. This should be solved in Substance generally (DOMElement, VirtualElement, and RenderingEngine)
            // For now, this just represents 'non-reflected' properties that we have needed so far
            // - value: needed for all types of input elements
            // - checked: input fields of type 'checkbox'
            // - selected: options of input fields of type 'select'
            case 'value':
            case 'checked':
            case 'selected': {
              // attribute is used as 'default' value
              _attributes[key] = val
              // and property as instance value
              _htmlProps[key] = val
              break
            }
            default: {
              _attributes[key] = val
            }
          }
        // no maginc HTML attribute mapping for Components, only plain properties
        } else {
          _props[key] = val
        }
      }
    }
    const el = createElement(type, _props)
    if (_ref) {
      el.ref(_ref)
    }
    if (_class) {
      el.addClass(_class)
    }
    if (_styles) {
      el.css(_styles)
    }
    el.attr(_attributes)
    el.htmlProp(_htmlProps)
    for (const [eventName, handler] of _eventListeners) {
      el.on(eventName, handler)
    }
    if (children.length > 0) {
      el.append(flatten(children))
    }
    return el
  }
@param {string | Class<Component>} type a HTML element name, or Component class
@param {object} props
@param  {...any} children