src/dom.js
function composeToFunction(JSXTag, elementProps, children) {
  const props = Object.assign({}, JSXTag.defaultProps || {}, elementProps, { children })
  const bridge = JSXTag.prototype.render ? new JSXTag(props).render : JSXTag
  const result = bridge(props)

  switch (result) {
    case 'FRAGMENT':
      return createFragmentFrom(children)

    // Portals are useful to render modals
    // allow render on a different element than the parent of the chain
    // and leave a comment instead
    case 'PORTAL':
      bridge.target.appendChild(createFragmentFrom(children))
      return document.createComment('Portal Used')
    default:
      return result
  }
}
function composeToFunction(JSXTag, elementProps, children) {
  const props = Object.assign({}, JSXTag.defaultProps || {}, elementProps, { children })
  const bridge = JSXTag.prototype.render ? new JSXTag(props).render : JSXTag
  const result = bridge(props)

  switch (result) {
    case 'FRAGMENT':
      return createFragmentFrom(children)

    // Portals are useful to render modals
    // allow render on a different element than the parent of the chain
    // and leave a comment instead
    case 'PORTAL':
      bridge.target.appendChild(createFragmentFrom(children))
      return document.createComment('Portal Used')
    default:
      return result
  }
}
function composeToFunction ( JSXTag , elementProps , children ) { const props = Object . assign ( { } , JSXTag . defaultProps || { } , elementProps , { children } ) const bridge = JSXTag . prototype . render ? new JSXTag ( props ) . render : JSXTag const result = bridge ( props ) switch ( result ) { case 'FRAGMENT' : return createFragmentFrom ( children ) // Portals are useful to render modals // allow render on a different element than the parent of the chain // and leave a comment instead case 'PORTAL' : bridge . target . appendChild ( createFragmentFrom ( children ) ) return document . createComment ( 'Portal Used' ) default : return result } }
The JSXTag will be unwrapped returning the html

@param  {Function} JSXTag name as string, e.g. 'div', 'span', 'svg'
@param  {Object} elementProps custom jsx attributes e.g. fn, strings
@param  {Array} children html nodes from inside de elements

@return {Function} returns de 'dom' (fn) executed, leaving the HTMLElement

JSXTag:  function Comp(props) {
return dom("span", null, props.num);
}
The JSXTag will be unwrapped returning the html