const renderLink = ({ currentLanguage, className, id, href, innerHTML }) =>
  `<a
    ${className ? `class='${className}'` : ''}
    ${id ? `id='${id}'` : ''}
    data-component='Link'
    data-props='${JSON.stringify({ href, innerHTML })}'
    href='${renderHref({ currentLanguage, href })}'
  >${innerHTML}</a>`

const renderHref = ({ currentLanguage, href }) =>
  currentLanguage
    ? `/${currentLanguage}${href}`
    : '#'

export default function createLink (ownProps, el) {
  const { store } = ownProps
  return {
    componentDidMount () {
      store.subscribe(state => render(calcProps(state), el))
    },
    render () {
      return render(calcProps(store.getState()), el)
    }
  }

  function calcProps (state) {
    return Object.assign({
      href: ownProps.href || '',
      innerHTML: ownProps.innerHTML || '',
      className: ownProps.className || '',
      id: ownProps.id || ''
    }, mapStateToProps(state))
  }
}

function render (props, el) {
  if (!el) return { replace: renderLink(props) }
  const href = renderHref(props)
  if (props.id) el.setAttribute('id', props.id)
  else el.removeAttribute('id')
  if (props.className) el.setAttribute('class', props.className)
  else el.removeAttribute('class')
  if (props.innerHTML !== el.innerHTML) el.innerHTML = props.innerHTML
  if (href !== el.getAttribute('href')) el.setAttribute('href', href)
}

function mapStateToProps (state) {
  return {
    currentLanguage: state.currentLanguage
  }
}

@@ -540,22 +540,16 @@
 unt () %7B
-%0A     
  store.s
@@ -561,72 +561,72 @@
 ibe(
-state =%3E render(calcProps(state), el))%0A    %7D,%0A    render
+onUpdate) %7D,%0A    render: onUpdate%0A  %7D%0A%0A  function onUpdate
  () %7B%0A
-  
     
@@ -676,14 +676,8 @@
 el)%0A
-    %7D%0A
   %7D%0A

Fix rerendering of `Link` component